-
Notifications
You must be signed in to change notification settings - Fork 633
test: Fix flaky task tracker doc test v1 #3414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Ryan McCormick <[email protected]>
@coderabbitai review |
✅ Actions performedReview triggered.
|
1 similar comment
✅ Actions performedReview triggered.
|
WalkthroughUpdates task execution to pass each task’s own cancellation token through all execution and continuation paths, replacing prior usage of child tokens from an inner token. Documentation gains a note clarifying Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant Tracker
participant Executor as TaskExecutor
participant Task
participant Cont as Continuation
participant CT as CancellationToken
Caller->>Tracker: spawn task
Tracker->>CT: obtain task-specific token
loop retry until completion
Tracker->>Executor: execute(Task, CT)
alt success
Executor-->>Tracker: completed
else continuation
Executor-->>Tracker: get continuation
Tracker->>Cont: execute(CT)
Cont-->>Tracker: result/next
else error/retry
Executor-->>Tracker: error
end
end
Tracker-->>Caller: Task result/handle
note over Tracker,Executor: CT is the task’s own token (no child token)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@coderabbitai what do you think of this fix? Is it correct, or is there a better or simpler alternative? Is the fix in the spirit of the original doctest? Review thoroughly. |
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed:
Length of output: 2685 🏁 Script executed:
Length of output: 247471 🏁 Script executed:
Length of output: 271477 Short answer
Details
Correctness of code changes
One minor inconsistency to consider fixing
Minimal patch // current (reschedule reacquisition)
guard_result = async {
inner
.scheduler
.acquire_execution_slot(inner.cancel_token.child_token())
.await
}
.instrument(tracing::debug_span!("scheduler_resource_reacquisition"))
.await;
// recommended
guard_result = async {
inner
.scheduler
.acquire_execution_slot(task_cancellation_token.child_token())
.await
}
.instrument(tracing::debug_span!("scheduler_resource_reacquisition"))
.await; Why this helps
Is there a simpler alternative to your fix?
Overall recommendation
If you want, I can sketch a small test for the reschedule-acquisition case. |
Overview:
Currently the doc test for task tracker is flaky, if you run this in a loop you should see occasional failures:
This PR aims to resolve the flakiness for more reliable CI.
Passes 100/100 time for me after this change.
Details
Example failure: https://github.com/ai-dynamo/dynamo/actions/runs/18143233794/job/51639015836
Summary by CodeRabbit
Bug Fixes
Documentation