← Back to Pull requests

test: fix two start-order and teardown races in native/local tests #7678

Closed
unknown closed this pull request without merging on Nov 20, 2026 03:01 UTC
View on GitHub
unknown unknown commented on Nov 18, 2026 06:17 UTC
Author

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_partitions compared the start order of two partitions that start concurrently on separate workers. It now checks the started set through assert_executed_once, which sorts, like the wait_started check a few lines above it.

  • cancel_wakes_a_waiting_reader asserted 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_busy in tests/bridge.rs still 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:

  • a 200 ms delay before partition 0 records its start;

  • the single runtime worker held busy for 500 ms by an unrelated task.
  • With no delay planted, fmt, clippy and the full datafusion-comet-local test suite pass, and each test passed 200 runs in a row.

    Diff: 195 lines (+146 / -49) across 2 files Reviewer: sunchao Review duration: 2684m
    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
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36% (MEDIUM) · Higher = larger blast radius
    36%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.2% · Safe to merge
    14.2%