Skip to content

Keep worker startup and cleanup from obscuring timing tests - #202

Open
tpn wants to merge 2 commits into
mainfrom
codex/worker-test-startup-20261116
Open

tpn wants to merge 2 commits into
mainfrom
codex/worker-test-startup-20261116

Conversation

@tpn

@tpn tpn commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

The NOOA cancellation test can exhaust its startup allowance before reaching the cancellation check. Give startup its own bounded wait and always cancel and reap the worker if that wait fails, while retaining the separate deadline test and bounded cleanup assertion.

The Dragon MPS success test also inherits a 0.2-second result/close timeout. Use the same 5-second allowance as neighboring real-worker tests. A delayed-close check reproduces this timing sensitivity; it does not establish the precise cause of the observed CI failure.

Validation

  • All 193 xLens tests pass with the optional NOOA runtime.
  • Dragon tests: 52 passed, 1 expected skip.
  • Real NOOA worker checks cover an 8-second delayed callback and cleanup after an injected startup timeout. Dragon success cases pass with a 300-millisecond close delay.
  • Standard changed-file hooks, mypy, lock and whitespace checks pass.

Repository hygiene

Tests only; no product behavior, dependency, generated artifact or release changes.

tpn added 2 commits November 16, 2026 12:28
Give the MPS ordering check the same filesystem deadline used by
other non-timeout Dragon tests so slow cleanup does not mask the
initialization behavior under test.

Signed-off-by: Trent Nelson <trentn@nvidia.com>
Signed-off-by: Trent Nelson <trentn@nvidia.com>
@tpn
tpn requested a review from melo-gonzo as a code owner November 16, 2026 20:29
@tpn tpn added the ai-review Request a focused CodeRabbit review label Nov 16, 2026
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Dragon MPS test now sets a result timeout. The NOOA backend cancellation test allows more time for the request to begin and ensures it cancels and awaits the task even if that wait fails.

Changes: Test timeout adjustments

Layer / File(s) Summary
Dragon MPS result timeout
tests/core/test_dragon.py
The MPS initialization-order test passes result_timeout=5.0 to _run.
NOOA cancellation test timing
tests/xlens/test_nooa_backend.py
The test uses a 60-second timeout and waits up to 30 seconds for the request to begin. A finally block cancels and awaits the task, and the test checks for CancelledError.

Possibly related PRs

  • NVIDIA/cuPhoton#171: Removes the optional NOOA engine, which is exercised by the NOOA cancellation test changed here.
Merge Risk: Minimal · up to 13273

This change adjusts test timing and cleanup only, with no production behavior change. No actionable merge risk was found.

Security architecture risk: Minimal · up to 13273

The changes make worker timing tests less sensitive to startup and cleanup delays while retaining deadline and cancellation assertions. No introduced or worsened design-level security or failure-containment risk was identified.

Pre-merge checks: Passed 2

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d8d8c76 and 1327383.

Files selected for processing: 2

  • tests/core/test_dragon.py
  • tests/xlens/test_nooa_backend.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 2 remain after this review.

@melo-gonzo melo-gonzo 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.

Thanks. I read this at 1327383. This is from code reading. I did not run the tests.

  • The Dragon MPS case now gets the same 5-second result_timeout as the other real-worker tests. #183's PR run hit this flake: the connected=True case returned failed, and the same test passed on the vetted copy of that commit.
  • The NOOA cancel case now waits up to 30 seconds for startup under a 60-second run deadline, so the deadline can no longer fire before the cancel. The finally cancels and reaps the worker even when startup times out, and that TimeoutError still fails the test. The deadline case keeps its 8-second limit.

No changes needed.

This branch has not been deployed

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

Labels

ai-review Request a focused CodeRabbit review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants