Skip to content

test(ut): stabilize cooperative helper cancellation fixtures - #30535

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
XuPeng-SH:fix/ut-cancellation-flaky-30281
Oct 18, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
XuPeng-SH:fix/ut-cancellation-flaky-30281

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Related to #30281.

What this PR does / why we need it:

Cooperative cancellation fixtures shortened the helper grace period to one second, below the runner's supported minimum. Under delayed completion, the parent KILLs the helper before its acknowledgement, retains the private report, and returns 125; the engine fixture's missing-report check then reports 92. This matches the failure boundary in the PR #30513 Ubuntu UT job.

Remove the three artificial grace overrides and use the existing 60-tick default. Strengthen the engine-registration and heavy/plan cases using their existing FIFOs: hold completion publication until the fifth real grace tick, verify the report is still unconsumed, then release and verify acknowledgement 143. Preserve the original cancellation entry points, real liveness/KILL/drain logic, exact report assertions and forced-stop controls. Production scripts and the outer test deadline stay unchanged. No retries, new sleeps or extra fixture processes are added.

Validation on Go 1.27.1:

  • A controlled short-grace mutation of the final tests fails both roots through actual KILL/empty acknowledgement/retained report, reproducing 125 and 92. The default-grace tests pass. This isolates the fixture-budget defect without claiming to reconstruct the original CI scheduler delay.
  • Complete macOS arm64/Bash 3.2 normal suite: 75 root and 359 named passes; two existing Linux-only cleanup skips.
  • Complete Linux arm64/Bash 5.2 race suite with CI short/tagged mode and parallel=8: 78 root and 365 named passes, no skips. Existing failed-drain, helper-KILL and escalation controls pass.
  • Adaptive exact-test Linux race repetitions: engine registration 23/23, heavy/plan 22/22, light/issues 100/100.
  • Incremental gofmt, vet, pinned molint and configured golangci-lint 2.14.0 over ./optools pass; lint reports 0 issues. Changed shell snippets pass bash -n.

Query execution has no added work. The two strengthened fixtures deliberately traverse five existing quarter-second ticks (about 1.25 seconds each) and remain parallel. No full Linux amd64 CI run is claimed; GitHub CI for this PR is pending. The issue also tracks distinct embedded cancellation cases, so leave it open for further verification.

@XuPeng-SH
XuPeng-SH requested a review from fengttt as a code owner October 18, 2026 16:04
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH

XuPeng-SH commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-xupeng · done

Commit: f9c2f3753e773e9411c55be2a0d6d06024abc95d

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-xupeng · review

Commit: f9c2f3753e773e9411c55be2a0d6d06024abc95d

Assessment: approve

Reviewed the complete test-only delta and cancellation ownership paths. The fixtures restore supported grace periods while preserving real escalation, acknowledgement, cleanup and report assertions. No actionable findings remain.

Model: gpt-6-astra / xhigh

Session: 01a14d34-4e51-79a3-a62d-6c9c16279dc8 · slot 0 · generation 0

Validation:

  • Isolation preflight passed; source remained unchanged.

  • Full optools suite passed: 78 root tests, 365 named passes, no skips.

  • All three changed tests passed under race detection. Adaptive repetitions passed: engine 18/18, heavy/plan 18/18, light/issues 47/47.

  • Diagnostic four-tick mutation failed both strengthened tests through real KILL escalation, reproducing engine status 92 and heavy/plan status 125.

  • Formatting and diff checks passed. Commands, source fingerprints, exit receipts and logs were reconciled in /home/xupeng/.local/state/mo-bot/jobs/14f40bd7108f0129eca2de26/attempt-1/validation-index.json.

Limitations:

  • Local validation used Linux amd64, Go 1.27.1 and Bash 5.2.37. Supplied CI was pending; author macOS/arm64 claims were not counted as verified execution evidence.

  • The controlled mutation establishes the fixture-budget failure, not the original CI scheduling delay or closure of the broader linked issue #30281.

This branch was previously deployed

1 inactive deployment
ci — 993f188a Deployed Oct 18, 2026 by XuPeng-SH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/test-ci size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants