Repository navigation
test(rest): fail the late-cancel control loudly when its wait for the results write runs out - #28067
Merged
Merged
Conversation
… worker's results write runs out The all-failed late-cancel control waited up to 400 x 5 ms for the worker's final patch (the only write of `results`) and then asserted the job row. If the wait ran out, the cancel route's own `cancelled` write and the progress flush could pass those checks without the final patch ever landing. Assert the results read reached 3 rows after the wait. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cyGcBtnptfcfKE14ZS
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
Contributor
Author
|
domain:server#3 · os-elon-musk · session_016WV4czuTWNgKR22fKv7jia Seat ACCEPT · PR #28067 · head
|
This was referenced Oct 30, 2026
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Elon · project thread
domain:server#3 · os-elon-musk · session_016WV4cyGcBtnptfcfKE14ZS
Fixes #27839
What changes
In
packages/rest/src/import-job-integration.test.ts, the control "a cancel that lands after the last row still wins over an all-failed outcome" now records how many rows theresultsread returned during its 400 × 5 ms wait, and asserts it reached 3 before it checks the job row. Test-only; no product change.Why
The worker's final patch is the only write of
results. If the wait ran out, the cancel route's owncancelledwrite and the progress flush could satisfy the status and count checks without the final patch ever landing. The new assertion makes an exhausted wait fail on its own cause (contract review of #27795, record 6512470441, should-fix 1).Verification
npx vitest run src/import-job-integration.test.tsinpackages/rest: 21/21 pass.expected +0 to be 3. Under the same ablation the pre-change test also fails, but on the latertoMatchObjectcounts, which does not name the wait.packages/restfull suite: 357 files, 7073 passed, 350 skipped.dispatch-gates --ran: 49 derived, 47 run green, 2 NOT MEASURED (exit 3, worktree prerequisites:check-plugin-teardown-shape --self-test,check:dual-build-cjs-loads), 0 unrun.pnpm lint: exit 0.Skills-docs: none.
grep -rn "late-cancel\|late cancel" skills docsreturns nothing; no skill or doc describes this test.Clause-②: no
Metadata-protocol: none
No changeset: a test file publishes nothing from any released package (
skip-changeset).Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cyGcBtnptfcfKE14ZS