fix: scan-ring env var may leak across tests on pytest.skip - #3388
Conversation
Greptile SummaryThe PR makes the scan-ring test environment override exception-safe and restores any pre-existing value after execution.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (4): Last reviewed commit: "[pre-commit.ci] auto fixes from pre-comm..." | Re-trigger Greptile |
- Add _scan_env context manager to set/restore NVTE_FUSED_RING_ATTENTION_USE_SCAN around runner.test_backward(). - Make test_scan_env_restored exception-safe on its outer cleanup path. Signed-off-by: Andrew White <andrewwhitecdw@users.noreply.github.com>
a6da1b8 to
376a997
Compare
|
@greptile-apps thanks for the review. I applied the suggested fix:
The branch has been amended to a single signed-off commit (376a997) and force-pushed. |
|
The fix looks correct. The The overall implementation is clean:
LGTM. |
for more information, see https://pre-commit.ci
This PR addresses the following issue in
tests/jax/test_distributed_fused_attn.py: scan-ring env var may leak across tests on pytest.skip.Changes
tests/jax/test_distributed_fused_attn.py: scan-ring env var may leak across tests on pytest.skip.Details
Tests
tests/jax/test_distributed_fused_attn.pyGreptile feedback addressed
test_scan_env_restoredintry/finally, so an unexpected assertion or exception no longer leaks the sentinel value into later tests.Local verification:
python3 -m py_compile tests/jax/test_distributed_fused_attn.pypassed. Full pytest execution was not feasible because JAX is not installed in this environment.