Skip to content

[Test] [AMD] diffusion: Avoid Python 3.11-only enterContext in test_usp_ring_replicated - #45409

Merged
yichiche merged 1 commit into
sgl-project:mainfrom
michaelzhang-ai:ci-fix/usp-ring-py310
Oct 21, 2026
Merged

yichiche merged 1 commit into
sgl-project:mainfrom
michaelzhang-ai:ci-fix/usp-ring-py310

Conversation

@michaelzhang-ai

@michaelzhang-ai michaelzhang-ai commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

What

Replace self.enterContext(patch(...)) in RingReplicatedBase.setUp (python/sglang/multimodal_gen/test/unit/test_usp_ring_replicated.py) with patcher.start() plus self.addCleanup(patcher.stop).

Why

unittest.TestCase.enterContext was added in Python 3.11. #44690 introduced this call, and on the rocm720 image (Python 3.10) all four tests in the file error in setUp with AttributeError: 'TestRingReplicatedPrefix' object has no attribute 'enterContext'. The rocm10 image runs Python 3.12 and passes.

Failing job:

The replacement is the standard 3.10-compatible equivalent and keeps the same lifetime: the patch is active for the test and removed in cleanup.

Test plan


CI States

Latest PR Test (Base): ✅ Run #39450136803
Latest PR Test (Extra): ❌ Run #39450136708
Latest PR Test (AMD ROCm 10): ❌ Run #39450136610

unittest.TestCase.enterContext is Python 3.11+, and the rocm720 image
runs Python 3.10, so every test in the file errors in setUp. Start the
patcher and register its stop with addCleanup instead.

@yichiche yichiche left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

diffusion SGLang Diffusion run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants