Skip to content

quest: plan making tests fit their timeout on the queue runner - #497

Merged
kixelated merged 5 commits into
mainfrom
quest-plan/worker-test-timeouts
Nov 5, 2026
Merged

kixelated merged 5 commits into
mainfrom
quest-plan/worker-test-timeouts

Conversation

@kixelated

@kixelated kixelated commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Plans quest/m0/queue-watcher/queue-test-timeouts.md, a follow-up of the land fixer's handback on moq-dev/quest#481. On 2026-11-04, 10 of 11 failed merge-queue runs failed in tests: 7 in Worker route tests (cloudflare/test/projects.test.ts four times, cloudflare/test/github.test.ts three times) and 3 in the root suite, including this PR's own run. Most were on PRs that didn't touch the failing code.

Changes

  • New quest [L] Tests fit their timeout on the queue runner in m0's queue-watcher epic, ranked before log pruning.
  • Its Plan records the evidence an implementer starts from:
    • It looks specific to the queue runner. Every check job on main that finished that day (27) passed both suites on GitHub-hosted Ubuntu. On base ba352ea8, the root suite took 122s there (run 41924220424) while the queue runner took 1590s at the same time (run 41924229558), and 125s and 372s in the next two queue runs on that base.
    • Some tests have little headroom even on an idle host: test/review.test.ts "a reviewer's usage limit exits 3 with its reset…", added by moq-dev/quest#471, runs four cases in one test and takes 3.3s of its 5s locally, right after moq-dev/quest#470 split that file to one variant per test for that reason.
    • test/land.test.ts "opens the halt issue when the base fixer's launch was lost" stalled: 0.4s alone, but its 30s timeout fired only at 1221s, so its worker ran no timers for about 20 minutes.
    • The Worker timeouts look like one test stalling on waitUntil background work, not a slow suite.
    • Earlier rounds on these tests: moq-dev/quest#112, moq-dev/quest#130, and moq-dev/quest#177.

Public API and wire impact: none, planning only.

Decisions

Settled with the maintainer in /quest-complete on 2026-11-04:

  • What should the quest's goal be?
    • ✅ Fix the root cause
    • Rejected: raise the timeout; leave it to the watcher
  • Which milestone?
    • ✅ m0, queue-watcher epic
    • Rejected: m1

On 2026-11-04, after the land fixer handed this PR back (comment), the maintainer chose to add the new evidence before re-queueing, widening the Goal and title if it showed the root suite was affected too. It did, so /quest-iterate made these choices for review:

  • Widened the Goal and title from the Worker's route tests to the root and Worker suites on the queue runner, and resized it [M] to [L].
  • Renamed the file from worker-test-timeouts.md to queue-test-timeouts.md, so its path names its role. Nothing outside this PR links it.
  • Dropped the earlier follow-up for the root-suite review.test.ts timeout, since the quest now covers it.

Validation

just check and just test pass in the Nix dev shell on 8e01e13e (vitest 1073 passed, 5 skipped; Worker 537 passed). On 1005e897, just check, quest check, and quest check --base origin/main pass.

Review

Skipped on 1005e897f9f552e8de1e3240c21293f1548b4053 as too trivial: its only change since the reviewed head rewraps one line of the quest file for Pullfrog's formatting nit, and git diff -w --word-diff against 8e01e13e shows no word changes.

Codex gpt-6.1-sol, effort xhigh, via quest review --base origin/main, round 2 on 8e01e13ed4df39b82bcbae38ea8b818e3e7e141b: no findings. Round 1 on f038009b also had none.

Evidence checked against the run logs: per-test durations in run 41924229558, run 41923472254, run 41928750874, and run 41924220424; the failing tests of all 11 failed merge_group runs on 2026-11-04 via gh run view --log-failed; and three local runs each of the usage-limit test (3.3s) and the halt-issue test (0.4s).

Follow-ups

None.

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

kixelated and others added 2 commits November 4, 2026 13:43
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d background work

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 4, 2026 21:59
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 842f24d0-3937-4f86-b5c5-d7ccb2bfa9eb
Commits

Reviewing files that changed from the base of the PR and between fcc76c3 and 1005e89.

Files selected for processing: 2
  • quest/m0/queue-watcher/README.md
  • quest/m0/queue-watcher/queue-test-timeouts.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

Reviewed the whole diff (2 files, 2 commits) plus the repo's format and evidence contract: this is a plan-only PR, so correctness is the accuracy of the quest document and its grounding.

  • New quest [M] Worker route tests fit their timeout (quest/m0/queue-watcher/worker-test-timeouts.md) with the required ## Goal and a ## Plan that records the settled decisions, the failure evidence, and implementation leads for the implementer.
  • Epic index row (quest/m0/queue-watcher/README.md) inserted in the ## Required list between "Harden the queue runners" and "Daemons prune their logs", matching the house - [link](...) - outcome style.

Every checkable claim verifies against the tree and GitHub:

  • Format: bun run --silent quest check passes (79 documents ok); headings, size tag, and the root-absolute /quest-m0/queue-watcher links resolve.
  • Code facts: waitUntil background work in cloudflare/src/github/webhook.ts; isolate: false and the /dev/shm TMPDIR line in cloudflare/vitest.config.ts; the single-workerd pool comment from #112; scripts/gate-bench.sh; the just worker-test-isolated recipe; github.test.ts really does stub no global fetch (its only fetch use is a per-service mock); the test/review.test.ts case name matches verbatim.
  • Run facts: gh run list --event merge_group --status failure --created 2026-11-04 shows exactly 10 failed queue runs that day, and all cited run IDs (41901538568, 41905766925, 41886648526, 41879887537) are among them. The "all 22 check jobs ran the whole Worker suite" lead is sound: check.yml's check job runs just check and then just test, whose _test recipe ends in just worker-test, on ubuntu-latest.
  • Process facts: the three-flaky stop rule is REQUEUE_LIMIT = 3 in src/cli/land-fixer.ts:228, so "#481 hit its three-flaky stop rule" is accurate; the runner-ownership correction (kixelated/nixos#19 added it, runners.md only restricts access) matches the cutover records.

The plan's guidance (measure host load before blaming the tests; hunt the webhook-started waitUntil work that outlives its test) follows directly from that evidence, and the body's recommendation to drop the root-suite timeout follow-up unless it recurs matches the guide's "drop one you would call optional".

Pullfrog  | View workflow run | Using glm-5.3-flash | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 4, 2026
@moq-bot

moq-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

quest land watch: the merge queue removed this pull request at f038009 because its merge_group build failed (failed_checks).

The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs.

Queue / Queue build / Build (job) failure at step Test:

…pect(empty.queue).toEqual([]);
�[90m �[2m❯�[22m processTicksAndRejections unknown:�[2m7:39�[22m�[39m

�[31m�[2m⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯�[22m�[39m

�[41m�[1m FAIL �[22m�[49m test/review.test.ts�[2m > �[22ma reviewer's usage limit exits 3 with its reset, and records no round
�[31m�[1mError�[22m: Test timed out in 5000ms.
If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".�[39m
�[36m �[2m❯�[22m <anonymous> test/review.test.ts:�[2m379:6�[22m�[39m
    �[90m377|�[39m  const round = review({ root: s.repo, signal: controller.signal }, { e…
    �[90m378|�[39m  while (!existsSync(pid)) await new Promise((resolve) => setTimeout(re…
    �[90m379|�[39m  controller.abort();
    �[90m   |�[39m      �[31m^�[39m
    �[90m380|�[39m  await expect(round).rejects.toThrow(/abort/i);
    �[90m381|�[39m  // The round fails only once the CLI exited, so nothing outlives it i…
�[90m �[2m❯�[22m processTicksAndRejections unknown:�[2m7:39�[22m�[39m


�[31m�[2m⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯�[22m�[39m

�[2m Test Files �[22m �[1m�[31m2 failed�[39m�[22m�[2m | �[22m�[1m�[32m27 passed�[39m�[22m�[90m (29)�[39m
�[2m      Tests �[22m �[1m�[31m2 failed�[39m�[22m�[2m | �[22m�[1m�[32m1073 passed�[39m�[22m�[2m | �[22m�[33m5 skipped�[39m�[90m (1080)�[39m
�[2m   Start at �[22m 14:21:56
�[2m   Duration �[22m 1589.77s�[2m (tests 92%, transform 6%, import 1%)�[22m


##[error]Error: Test timed out in 30000ms.
If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".
 ❯ <anonymous> test/land.test.ts:1591:32
 ❯ processTicksAndRejections unknown:7:39



##[error]Error: Test timed out in 5000ms.
If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".
 ❯ <anonymous> test/review.test.ts:379:6
 ❯ processTicksAndRejections unknown:7:39


error: script "test" exited with code 1
error: recipe `_test` failed on line 33 with exit code 1
error: recipe `test` failed on line 30 with exit code 1
##[error]Process completed with exit code 1.
Post job cleanup.
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git version
git version 2.55.0
Temporarily overriding HOME='/var/cache/github-runner-work/_temp/24332dd9-ebc6-41a3-8e6e-d9ba95256545' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git config --global --add safe.directory /var/cache/github-runner-work/quest/quest
Removing SSH command configuration
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git config --local --name-only --get-regexp core\.sshCommand
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git config --local --name-only --get-regexp ^includeIf\.gitdir:
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Post job cleanup.
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git version
git version 2.55.0
Temporarily overriding HOME='/var/cache/github-runner-work/_temp/5afb61f4-2030-47d3-98e6-9a69410f57ef' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git config --global --add safe.directory /var/cache/github-runner-work/quest/quest
Removing SSH command configuration
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git config --local --name-only --get-regexp core\.sshCommand
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git config --local --name-only --get-regexp ^includeIf\.gitdir:
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
A job completed hook has been configured by the self-hosted runner administrator
##[group]Run '/nix/store/gx2v6q84b0w43bafm0whkdx93qyxbpps-ci-cache-gc.sh/bin/ci-cache-gc.sh'
shell: /nix/store/1mv3qz005gkbalxfghk4y3s8ayv4d2dl-bash-interactive-5.3p15/bin/bash --noprofile --norc -e -o pipefail {0}
##[endgroup]
evicted 0 objects and 0 action results (0 B logical); 50.0 GiB logical remain
dropped 1 stale checkout records
Cleaning up orphan processes

Queue / Queue (job) failure at step Require the build to pass:

Current runner version: '2.338.2'
##[group]Runner Image Provisioner
Hosted Compute Agent
Version: 20261021.618
Commit: 21505ad2541d5be6135ed84fc33697146cf75b8e
Build Date: 2026-10-21T00:45:21Z
Worker ID: {6788a9f0-468b-4aef-84f3-d881e0908de9}
Region: northcentralus
Cloud: Azure
##[endgroup]
##[group]Operating System
Ubuntu
24.04.5
LTS
##[endgroup]
##[group]Runner Image
Image: ubuntu-24.04
Version: 20261025.353.1
Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20261025.353/images/ubuntu/Ubuntu2404-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20261025.353
##[endgroup]
##[group]GITHUB_TOKEN Permissions
Contents: read
Metadata: read
PullRequests: read
##[endgroup]
Secret source: Actions
Cache mode: write
Prepare workflow directory
Prepare all required actions
Complete job name: Queue
##[group]Run [[ "$RESULT" == success ]] || { echo "::error::the queue build ended $RESULT" >&2; exit 1; }
�[36;1m[[ "$RESULT" == success ]] || { echo "::error::the queue build ended $RESULT" >&2; exit 1; }�[0m
shell: /usr/bin/bash -e {0}
env:
  RESULT: failure
##[endgroup]
##[error]the queue build ended failure
##[error]Process completed with exit code 1.
Cleaning up orphan processes

(written by quest land watch)

@moq-bot

moq-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

codex / Codex land fixer note:

The merge with the current base changes only two Markdown files and introduces no checks or executable changes, so no blame is assigned to this PR. Its branch remains at f038009.

Failure-log evidence:

1026: FAIL test/land.test.ts > host daemon > opens the halt issue when the base fixer's launch was lost
1027: Error: Test timed out in 30000ms.
1040: FAIL test/review.test.ts > a reviewer's usage limit exits 3 with its reset, and records no round
1041: Error: Test timed out in 5000ms.

On a temporary merge of base and this PR, bun run build, bun run check, and bun run --silent quest check passed. A targeted run of both failed tests passed the halt-issue test but reproduced the reviewer usage-limit timeout: Error: Test timed out in 5000ms. The full bun run test run was stopped after this independent reproduction. A passing test result could not be verified, so this is handed back for investigation of the base's reviewer timeout without modifying this PR.

(written by codex / Codex)

@moq-bot

moq-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

codex / Codex land fixer: On base plus &#35;497, &#96;bun run test test/land.test.ts test/review.test.ts -t "opens the halt issue when the base fixer's launch was lost|a reviewer's usage limit exits 3 with its reset, and records no ro. Recommendation: Investigate the reviewer usage-limit timeout on the base and rerun the checks before requeueing; leave this documentation-only PR unchanged.

�[41m�[1m FAIL �[22m�[49m test/land.test.ts�[2m > �[22mhost daemon�[2m > �[22mopens the halt issue when the base fixer's launch was lost
�[31m�[1mError�[22m: Test timed out in 30000ms.
If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".�[39m
�[36m �[2m❯�[22m <anonymous> test/land.test.ts:�[2m1591:32�[22m�[39m
    �[90m1589|�[39m   forge.repo.pulls[0].landing = false;
    �[90m1590|�[39m   forge.advance({ "fixed.txt": "yes" });
    �[90m1591|�[39m   writeFileSync(options.sandbox, "#!/bin/sh\nexit 0\n", { mode: 0o755 …
    �[90m   |�[39m                                �[31m^�[39m
    �[90m1592|�[39m   const empty = await resolveQueue(REPOSITORY, SQUASH, deps);
    �[90m1593|�[39m   expect(empty.queue).toEqual([]);
�[90m �[2m❯�[22m processTicksAndRejections unknown:�[2m7:39�[22m�[39m

�[31m�[2m⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯�[22m�[39m

�[41m�[1m FAIL �[22m�[49m test/review.test.ts�[2m > �[22ma reviewer's usage limit exits 3 with its reset, and records no round
�[31m�[1mError�[22m: Test timed out in 5000ms.
If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".�[39m
�[36m �[2m❯�[22m <anonymous> test/review.test.ts:�[2m379:6�[22m�[39m
    �[90m377|�[39m  const round = review({ root: s.repo, signal: controller.signal }, { e…
    �[90m378|�[39m  while (!existsSync(pid)) await new Promise((resolve) => setTimeout(re…
    �[90m379|�[39m  controller.abort();
    �[90m   |�[39m      �[31m^�[39m
    �[90m380|�[39m  await expect(round).rejects.toThrow(/abort/i);
    �[90m381|�[39m  // The round fails only once the CLI exited, so nothing outlives it i…

(written by codex / Codex)

kixelated and others added 2 commits November 4, 2026 15:01
#497's own merge-group run failed on two root-suite tests while it
changes only Markdown, and the same base passed in 122s on
GitHub-hosted Ubuntu against 1590s on the queue runner. Rename the
quest to match its wider goal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title quest: plan fixing the Worker route test timeouts in the merge queue quest: plan making tests fit their timeout on the queue runner Nov 4, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ℹ️ No critical issues — one small formatting nit inline, and the widened evidence all checks out.

Reviewed changes

Re-reviewed the two commits since the prior pullfrog review (f038009): the quest was widened from the Worker route tests to both suites on the queue runner and resized [M] → [L].

  • Retitled the quest to [L] Tests fit their timeout on the queue runner, widened its Goal to the root and Worker suites, and renamed the file to queue-test-timeouts.md; the epic index row follows.
  • Rewrote the evidence block to "10 of 11 failed merge-queue runs failed in tests": Worker 7 runs (projects ×4, github ×3) plus root 3 runs, with run citations and the review/land/gate timeouts.
  • Replaced the "22 check jobs" lead with the count of check jobs on main that finished that day and a cross-runner duration comparison (122s hosted vs 1590s queue on the same base, then 125s and 372s).
  • Added implementation leads for low-headroom tests (the review.test.ts usage-limit case, #470's split) and the land.test.ts stall (1221s against its 30s limit, spawnSync in git()).

I verified the new numbers directly: the 11 failed merge_group runs on 2026-11-04 via their failed logs (7 Worker, 3 root, and one that failed quest check on broken links instead of tests, so "10 of 11" is exact), the 1221s/30s land stall and 5917ms review timeout in run 41924229558, and the "27 check jobs" claim (25 successful runs plus 2 runs whose Ubuntu check job passed while Windows failed). Test names and spawnSync in src/cli/git.ts verify in the tree, and quest check --base origin/main passes.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using glm-5.3-flash | 𝕏

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit d3719f0 Nov 5, 2026
10 checks passed
@kixelated
kixelated deleted the quest-plan/worker-test-timeouts branch November 5, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant