Skip to content

Increase number of retries for Pubchem test even more#1286

Merged
mhucka merged 1 commit into
quantumlib:mainfrom
mhucka:increase-pubchem-retries-more
Apr 24, 2026
Merged

Increase number of retries for Pubchem test even more#1286
mhucka merged 1 commit into
quantumlib:mainfrom
mhucka:increase-pubchem-retries-more

Conversation

@mhucka
Copy link
Copy Markdown
Contributor

@mhucka mhucka commented Apr 24, 2026

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:

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).

It is still failing, but I found a way to reproduce it locally. Using
that testing, I found that this combination allows it to get through
even very many server busy errors.
@mhucka mhucka marked this pull request as ready for review April 24, 2026 17:03
@mhucka mhucka requested review from fdmalone and pavoljuhas April 24, 2026 17:04
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request increases the retry count from 4 to 8 for the test_geometry_from_pubchem_live_api test to better handle flakiness. A review comment points out a discrepancy between the code and the PR description, noting that the delay parameter was not increased as intended.

Comment thread src/openfermion/chem/pubchem_test.py
@mhucka mhucka changed the title Increase delay & number of retries for Pubchem test even more Increase number of retries for Pubchem test even more Apr 24, 2026
@mhucka mhucka added this pull request to the merge queue Apr 24, 2026
Merged via the queue into quantumlib:main with commit c7038b0 Apr 24, 2026
18 checks passed
@mhucka mhucka deleted the increase-pubchem-retries-more branch April 24, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants