Skip to content

test(paro): make the prewarm gating test independent of session state (#5430) - #5442

Merged
Qubitium merged 1 commit into
mainfrom
fix/5430-paro-prewarm-test-isolation
Nov 19, 2026
Merged

Qubitium merged 1 commit into
mainfrom
fix/5430-paro-prewarm-test-isolation

Conversation

@Qubitium

@Qubitium Qubitium commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

tests/test_paro.py::test_paro_prewarm_rotation_extension_skips_unsupported_configs patched _PARO_ROTATION_EXTENSION.load and asserted it was called exactly once. The product never reaches that attribute once the extension is loaded:

def _load_rotation_extension() -> bool:
    global _ROTATION_EXTENSION_READY
    if _ROTATION_EXTENSION_READY:
        return True                       # <- short-circuits here
    loaded = _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 ran a real fused rotation set the flag, and the assertion became assert [] == ['load'].

Fix

  • Patch the seam the product actually calls — 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 return False without attempting a load, and the supported one attempts exactly one.
  • Add test_paro_prewarm_reports_true_when_the_extension_is_already_loaded, which pins the process state the old test tripped on: with _ROTATION_EXTENSION_READY already True, a prewarm must return True without probing is_available (i.e. without rebuilding).

Red -> green (GPU, main @ 8618744ac)

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 \
       tests/test_paro.py::test_paro_prewarm_rotation_extension_skips_unsupported_configs
before: 1 failed, 5 passed
after:  6 passed

Whole-file ordering check (the shape that made this red in CI):

pytest tests/test_paro_rotation_inference_cache_5317.py tests/test_paro.py
main @ 8618744ac: 1 failed, 246 passed
this branch:      248 passed

Both repros from the issue are covered, and pytest tests/test_paro.py is 245 passed (244 + the new test). All twelve tests/test_paro*.py files 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

…#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
@Qubitium
Qubitium marked this pull request as ready for review November 19, 2026 05:31
@Qubitium
Qubitium merged commit e099693 into main Nov 19, 2026
6 checks passed
@Qubitium
Qubitium deleted the fix/5430-paro-prewarm-test-isolation branch November 19, 2026 05: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

1 participant