Repository navigation
test(paro): make the prewarm gating test independent of session state (#5430) - #5442
Merged
Merged
Conversation
…#5430) `test_paro_prewarm_rotation_extension_skips_unsupported_configs` patched `_PARO_ROTATION_EXTENSION.load` and expected one call. The product never reaches that attribute once the extension is loaded: `prewarm_*` calls `_load_rotation_extension()`, which returns True immediately from the module global `_ROTATION_EXTENSION_READY` and otherwise asks `_extension_api().is_available("paro")`. So the test only passed when it was the first thing in the process to touch the extension. Any earlier test that runs a real fused rotation set the flag and the assertion became `assert [] == ['load']`. Patch the seam the product actually calls, `_load_rotation_extension`, which is already how the neighbouring tests in this file spy on the same helper, and add a test that pins the "already loaded" state the old test tripped on: a prewarm there must return True without probing or rebuilding. Verified on main 8618744: pytest tests/test_paro_rotation_inference_cache_5317.py \ tests/test_paro.py::test_paro_prewarm_rotation_extension_skips_unsupported_configs before: 1 failed, 3 passed (assert [] == ['load']) after: 4 passed pytest tests/kernels/test_paro_triton_cudagraph_5225.py <same test> before: 1 failed, 5 passed after: 6 passed pytest tests/test_paro.py: 245 passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/test_paro.py::test_paro_prewarm_rotation_extension_skips_unsupported_configspatched_PARO_ROTATION_EXTENSION.loadand asserted it was called exactly once. The product never reaches that attribute once the extension is loaded:So the test only passed when it was the first thing in the process to touch the extension. Any earlier test that ran a real fused rotation set the flag, and the assertion became
assert [] == ['load'].Fix
paro_utils_module._load_rotation_extension— which is already how the neighbouring tests in this file spy on the same helper (tests/test_paro.py:2839,:2904,:6277). The gating contract is unchanged: unsupported configs must returnFalsewithout attempting a load, and the supported one attempts exactly one.test_paro_prewarm_reports_true_when_the_extension_is_already_loaded, which pins the process state the old test tripped on: with_ROTATION_EXTENSION_READYalreadyTrue, a prewarm must returnTruewithout probingis_available(i.e. without rebuilding).Red -> green (GPU,
main@8618744ac)Whole-file ordering check (the shape that made this red in CI):
Both repros from the issue are covered, and
pytest tests/test_paro.pyis 245 passed (244 + the new test). All twelvetests/test_paro*.pyfiles in one session: 311 passed.uvx [email protected] check gptqmodel docs/eora tests setup.py: clean.No product code changes: the short-circuit is correct and intentional; only the test was coupled to session state.
Fixes #5430