Sporadic test failures in `test_name_resolve_cache`
See original GitHub issueDescription
I am seeing inconsistent failures in the above test when get_icrs_coordinates
is not using the expected URL:
@pytest.mark.remote_data
def test_name_resolve_cache(tmpdir):
from astropy.utils.data import get_cached_urls
target_name = "castor"
temp_cache_dir = str(tmpdir.mkdir('cache'))
with paths.set_temp_cache(temp_cache_dir, delete=True):
assert len(get_cached_urls()) == 0
icrs1 = get_icrs_coordinates(target_name, cache=True)
urls = get_cached_urls()
assert len(urls) == 1
> assert 'http://cdsweb.u-strasbg.fr/cgi-bin/nph-sesame/' in urls[0]
E AssertionError: assert 'http://cdsweb.u-strasbg.fr/cgi-bin/nph-sesame/' in 'http://vizier.cfa.harvard.edu/viz-bin/nph-sesame/A?castor'
/opt/lib/python3.9/site-packages/astropy/coordinates/tests/test_name_resolve.py:158: AssertionError
Apparently the function is somewhat randomly using the Vizier instead of the CDS mirror (this is from a European domain).
System Details
macOS-10.14.6-x86_64-i386-64bit Python 3.9.5 (default, May 14 2021, 02:39:23) [Clang 11.0.0 (clang-1100.0.33.17)] Numpy 1.21.0rc2 astropy 4.3rc1 Scipy 1.6.3 Matplotlib 3.3.3
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (9 by maintainers)
Top Results From Across the Web
What is a good test review process for sporadic failures
i am talking about test problems. this is where usually a failure is sporadic. Indeed the tests can fail for reasons like networking....
Read more >How to Fix Flaky Tests - Semaphore CI
Randomly failing tests are the hardest to debug. Here's a framework you can use to fix them and keep your test suite healthy....
Read more >How to reduce flaky test failures - CircleCI
Flaky tests, also known as flappers, fail to produce accurate and consistent results. These tests may be unreliable because of newly-written ...
Read more >Debugging Intermittent Test Failures - Firefox Source Docs
Intermittents are test failures which happen intermittently, in a seemingly random way. Often you'll write a test that passes fine locally on your...
Read more >Diagnosing Random Angular Test Failures - WalkingRiver.com
Have you ever had an intermittent or random failure in your unit tests? ... The fact that the new test and the failing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Wait. That almost works. Also need an itertools ~permute~ product.
Edit: Here’s something that works for any length
urls
andsesame_url
, exploring all permutationsDoes #11871 work for you?
p.s. I am unable to tag @nstarman as a reviewer, so FYI here. Thanks!