Skip to content

Skip Pubchem live API test in CI#1288

Merged
mhucka merged 7 commits intoquantumlib:mainfrom
mhucka:skip-pubchem-api-test-in-ci
Apr 27, 2026
Merged

Skip Pubchem live API test in CI#1288
mhucka merged 7 commits intoquantumlib:mainfrom
mhucka:skip-pubchem-api-test-in-ci

Conversation

@mhucka
Copy link
Copy Markdown
Contributor

@mhucka mhucka commented Apr 27, 2026

Even with many retries and long delays, the test fails for almost every PR. I don't know why this has been happening lately; perhaps Pubchem's servers have become overloaded lately (possibly due to an increase in the use of AI agents?). In any case, there seems to be no good solution to stop flaky failures in CI except to simply skip the test in CI.

The approach implemented here tests an environment variable set by GitHub in their runner environments. If that variable is set, the live API test is skipped; otherwise, it's run as usual. This means that developers in their normal local environments will run the tests as usual, and don't have to do anything special. In addition, our CI workflows don't need to change either.

Even with many retries and long delays, the test fails for almost every
PR. I don't know why; perhaps Pubchem's servers have become overloaded
lately (plausibly due to the increase in the use of AI agents). There
seems to be no good solution except to simply skip the test in CI.
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 introduces a skip condition for live PubChem API tests when running in CI environments and reduces the retry count for these tests. Feedback recommends making the CI detection more robust by checking for the variable's existence rather than a specific string value and suggests reverting the retry count reduction to maintain test stability during local execution.

Comment thread src/openfermion/chem/pubchem_test.py Outdated
Comment thread src/openfermion/chem/pubchem_test.py Outdated
mhucka and others added 2 commits April 27, 2026 11:19
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
I don't know why I thought it would be better to reduce it to 4.
@mhucka
Copy link
Copy Markdown
Contributor Author

mhucka commented Apr 27, 2026

/gemini review

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 updates 'src/openfermion/chem/pubchem_test.py' to skip live API tests when running in a CI environment. It introduces a 'skip_in_ci' decorator that checks for the 'CI' environment variable and applies it to the 'test_geometry_from_pubchem_live_api' test case to prevent failures caused by busy PubChem servers. Additionally, it reorders imports and adds the 'os' module. I have no feedback to provide.

@mhucka
Copy link
Copy Markdown
Contributor Author

mhucka commented Apr 27, 2026

/gemini review

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 updates the PubChem test suite to skip live API tests when running in a CI environment. It introduces an import for the os module and defines a skip_in_ci decorator to prevent intermittent test failures caused by server availability issues. I have no feedback to provide.

@mhucka mhucka added the area/devops Involves build systems, Make files, Bazel files, continuous integration, and or other DevOps topics label Apr 27, 2026
Comment thread src/openfermion/chem/pubchem_test.py Outdated
Comment thread src/openfermion/chem/pubchem_test.py Outdated
Copy link
Copy Markdown
Contributor

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

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

LGTM after addressing inline suggestions.

mhucka and others added 2 commits April 27, 2026 15:55
Co-authored-by: Pavol Juhas <pavol.juhas@gmail.com>
@mhucka
Copy link
Copy Markdown
Contributor Author

mhucka commented Apr 27, 2026

LGTM after addressing inline suggestions.

Thanks for those great suggestions.

@mhucka mhucka requested a review from pavoljuhas April 27, 2026 23:12
@mhucka mhucka added this pull request to the merge queue Apr 27, 2026
Merged via the queue into quantumlib:main with commit cf66a25 Apr 27, 2026
18 checks passed
@mhucka mhucka deleted the skip-pubchem-api-test-in-ci branch April 27, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/devops Involves build systems, Make files, Bazel files, continuous integration, and or other DevOps topics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants