Repository navigation
test(global-workspace): wait for startup recovery before seeding in_progress tasks - #146
Merged
Merged
Conversation
…rogress tasks server.js re-arms every in_progress task with no live worker in a setTimeout(..., 3000) after boot. The suite seeds in_progress fixtures as soon as setup completes, so on a slow run the recovery pass flipped them to todo before the overview was read (1 in ~7 runs failed the totals and Beta rollup checks). The recovery callback now prints an unconditional '[startup] in_progress recovery complete' line after processQueue(), and the test waits for it in the captured server output before creating fixtures, instead of relying on a fixed sleep.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Problem
test/global-workspace.test.jsfailed in roughly 1 of 7 runs:totals count every task in every project — expected [8,4,1,2,1], got [8,4,2,1,1]Beta rolls up its own tasks only — expected [4,1,1,1,1], got [4,1,2,0,1]server.jsruns a startup recovery insetTimeout(..., 3000)("Kick off on startup — smart recovery for in_progress tasks") that moves everyin_progresstask with no live worker totodo, then callsprocessQueue(). The suite seeds itsin_progressfixtures as soon as setup completes (~1 s after boot). When the overview was read after the 3 s mark, both fixtures had been flipped totodo, andprocessQueue()then picked the past-due "alpha overdue run" back up — leaving exactly todo=2 / in_progress=1 with Beta's task intodo.Change
server.js: one unconditionalconsole.log('[startup] in_progress recovery complete')at the end of that callback, afterprocessQueue(), with a comment saying why it exists.console, notlog, because the suite boots withLOG_LEVEL=error.test/global-workspace.test.js: before creating fixtures, wait (polling, 30 s bound) for that line in the server output the suite already captures. No fixed sleep; assertions unchanged.Proof
mainwith the exact signature above, 3/3 pass with this change.