[https://nvbugs/6260897][fix] Relax line-589 assertion to accept either IN_PROGRESS or SUCCESS (FAILURE… - #15121
Conversation
📝 WalkthroughWalkthroughThis PR fixes a test that was previously being skipped due to timing sensitivity. The test ChangesTransfer Wait Timeout Test Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/unittest/bindings/test_transfer_agent_bindings.py (1)
805-806: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winApply the same assertion fix to the Mooncake test.
The Mooncake test
test_mooncake_wait_in_progress_on_zero_timeoutuses a strict assertion that expectsIN_PROGRESS, but it can encounter the same race condition as the NIXL test: on fast loopback paths, the progress thread may complete the transfer beforewait(timeout_ms=0)is called. Consider relaxing this assertion to match the NIXL test fix.Proposed fix for consistency
+ # With timeout_ms=0, wait checks status once and returns immediately. + # Either IN_PROGRESS (transfer still running) or SUCCESS (transfer + # already completed by the progress thread on a fast loopback path) + # is a valid non-blocking observation; FAILURE would indicate a bug. result = status.wait(timeout_ms=0) - assert result == tab.TransferState.IN_PROGRESS + assert result in (tab.TransferState.IN_PROGRESS, tab.TransferState.SUCCESS)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/unittest/bindings/test_transfer_agent_bindings.py` around lines 805 - 806, The Mooncake test test_mooncake_wait_in_progress_on_zero_timeout currently asserts strictly that status.wait(timeout_ms=0) == tab.TransferState.IN_PROGRESS; relax this to accept either tab.TransferState.IN_PROGRESS or tab.TransferState.COMPLETED (same approach as the NIXL test) to handle the race where the progress thread may finish before wait is called—check the result of status.wait(timeout_ms=0) and assert it is in {tab.TransferState.IN_PROGRESS, tab.TransferState.COMPLETED}.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@tests/unittest/bindings/test_transfer_agent_bindings.py`:
- Around line 805-806: The Mooncake test
test_mooncake_wait_in_progress_on_zero_timeout currently asserts strictly that
status.wait(timeout_ms=0) == tab.TransferState.IN_PROGRESS; relax this to accept
either tab.TransferState.IN_PROGRESS or tab.TransferState.COMPLETED (same
approach as the NIXL test) to handle the race where the progress thread may
finish before wait is called—check the result of status.wait(timeout_ms=0) and
assert it is in {tab.TransferState.IN_PROGRESS, tab.TransferState.COMPLETED}.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 0820ab15-e524-4535-9048-b9a40cdcede2
📒 Files selected for processing (2)
tests/integration/test_lists/waives.txttests/unittest/bindings/test_transfer_agent_bindings.py
💤 Files with no reviewable changes (1)
- tests/integration/test_lists/waives.txt
a1fc718 to
adb3f7f
Compare
039a791 to
9a6368c
Compare
7fd8387 to
bc7742f
Compare
The test asserted wait(timeout_ms=0) always returns IN_PROGRESS, but on a fast intra-host loopback the NIXL progress thread can finish a 40MB GPU WRITE before the Python caller polls, in which case wait correctly returns SUCCESS on its first observation. Both outcomes are valid for a non-blocking poll; only FAILURE would indicate a bug. Relax the assertion to accept either IN_PROGRESS or SUCCESS, and remove the stale waiver entry. Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
bc7742f to
8054efc
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #59375 [ run ] triggered by Bot. Commit: |
|
PR_Github #59375 [ run ] completed with state |
BowenFu
left a comment
There was a problem hiding this comment.
LGTM — test-only relaxation that matches a genuine race: a non-blocking wait(timeout_ms=0) can legitimately observe SUCCESS when the progress thread finishes the loopback WRITE before the poll. FAILURE is still asserted and all downstream SUCCESS/data-equality checks remain, so no real error is masked.
Summary
Test plan
Links
Summary by CodeRabbit
Tests