Skip to content

Mark a few more tests as slow#1292

Open
mhucka wants to merge 6 commits intoquantumlib:mainfrom
mhucka:mark-more-slow-tests
Open

Mark a few more tests as slow#1292
mhucka wants to merge 6 commits intoquantumlib:mainfrom
mhucka:mark-more-slow-tests

Conversation

@mhucka
Copy link
Copy Markdown
Contributor

@mhucka mhucka commented Apr 28, 2026

Some of the tests are extremely time-consuming on even a fast parallel Linux VM. Two of tests marked in this commit clocked in at 20 minutes each even when running with -n 30. The following numbers are from using the pytest --durations option:

  • 1288.49s call src/openfermion/ops/representations/doci_hamiltonian_test.py::IntegralTransformsTest::test_fermionic_hamiltonian_from_integrals

  • 1208.20s call src/openfermion/transforms/opconversions/remove_symmetry_qubits_test.py::ReduceSymmetryQubitsTest::test_energy_reduce_symmetry_qubits

Two other tests were in the 600-700 sec range, and they are marked as slow in this PR as well. The use of @pytest.mark.slow allows the user to run pytest with -m "not slow" to skip the these tests and some other tests in OpenFermion that are already marked as slow.

Note: the changes to the imports are purely formatting/linting changes brought about by running check/format-incremental.

mhucka added 4 commits April 28, 2026 00:35
Some of the tests are extremely time-consuming on even a fast parallel
Linux VM. The two tests marked in this commit clocked in at **20
minutes** each. The following numbers are from using the pytest
`--durations` option:

1288.49s call     src/openfermion/ops/representations/doci_hamiltonian_test.py::IntegralTransformsTest::test_fermionic_hamiltonian_from_integrals

1208.20s call     src/openfermion/transforms/opconversions/remove_symmetry_qubits_test.py::ReduceSymmetryQubitsTest::test_energy_reduce_symmetry_qubits
We don't run isort in check/format-incremental. I didn't need to run it
manually in the previous commit.
@mhucka mhucka marked this pull request as ready for review April 28, 2026 00:59
@mhucka mhucka requested review from fdmalone and mpharrigan April 28, 2026 00:59
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 the @pytest.mark.slow decorator to several long-running tests to optimize CI performance and removes unused imports in doci_hamiltonian_test.py. Feedback indicates that test_kpoint_isdf_single_translation was identified as slow in the PR description but was missed in the code changes, and should be marked accordingly.

Comment thread src/openfermion/resource_estimates/pbc/thc/factorizations/isdf_test.py Outdated
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.

1 participant