Skip to content

Commit c7038b0

Browse files
authored
Increase number of retries for Pubchem test even more (#1286)
The Pubchem live api test in `src/openfermion/chem/pubchem_test.py` would still fail too frequently in CI. After finally finding a way to reproduce it locally, I tweaked the retries parameter for pytest so that it succeeds locally. That's not a guarantee it won't fail again in CI (because it depends on how busy the Pubchem server is at a given time), but the number of retries and delay now are so high that I haven't been able to get it to fail due to retries. Approach to seeing retries in local testing: ```shell pip install pytest-repeat ./check/pytest -n 4 --count=30 --repeat-scope=session src/openfermion/chem/pubchem_test.py ``` The number of parallel threads in `-n` does not have to be 4 exactly, but lower numbers are less likely to trigger retries. The repeat count of 30 also can be a little bit lower, but at lower values, there's a higher chance that all tests will pass without retries (probably depending on the server load at the time).
1 parent eebf875 commit c7038b0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/openfermion/chem/pubchem_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def test_water_2d(self, monkeypatch):
149149
with pytest.raises(ValueError, match='Incorrect value for the argument structure'):
150150
_ = geometry_from_pubchem('water', structure='foo')
151151

152-
@pytest.mark.flaky(retries=4, delay=30, only_on=[pubchempy.ServerBusyError])
152+
@pytest.mark.flaky(retries=8, delay=30, only_on=[pubchempy.ServerBusyError])
153153
def test_geometry_from_pubchem_live_api(self):
154154
water_geometry = geometry_from_pubchem('water')
155155
assert len(water_geometry) == 3

0 commit comments

Comments
 (0)