test: fix two start-order and teardown races in native/local tests #7678
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 195 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.316
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #7678"
general
weight: 0.35
sunchao
Which issue does this PR close?
Closes #7676.
Closes #7677.
Rationale for this change
Two tests in
native/local, both added in #6883, fail intermittently and have been evicting unrelated pull requests from the merge queue (#7556, #7464, #7508). Each one asserts something the code doesn't guarantee.What changes are included in this PR?
partition_order_runs_at_most_the_given_number_of_partitionscompared the start order of two partitions that start concurrently on separate workers. It now checks the started set throughassert_executed_once, which sorts, like thewait_startedcheck a few lines above it.cancel_wakes_a_waiting_readerasserted the plan was released as soon as the cancelled reader returned. An aborted partition task that hasn't run yet still owns its start closure, and with it the plan, until a runtime worker drops the task. The test now waits up to 5 seconds for the count to reach zero, as the other teardown checks in the crate do.cancel_releases_the_graph_while_every_worker_is_busyintests/bridge.rsstill covers the stream being dropped on the calling thread.How are these changes tested?
Both are test changes. I forced each race and confirmed the old assertion failed every time with the same message as CI, while the new one passed:
With no delay planted, fmt, clippy and the full
datafusion-comet-localtest suite pass, and each test passed 200 runs in a row.