Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:2m2pliz5wl is past its budget: trevato/forge: "a fast-forward applies the previewed id: a parent that moved after it is not taken" failed on 3 pulls i… #14563
Merged 13d 13h ago, live in production
The flaky test is fixed in test/take-expect.test.ts. I ran it three times in a row with all tests passing, and tsc and scripts/gate.ts --fix are clean. Cause: in the test setup, Alice commits "Next" to each repo, and the forge's own follow then fast-forwards Bob's fork in the background.
-
Reviews
ApprovedTest-only, 9 lines, no src/ change, so there is no page, terminal screen or README impact. I checked the fix against src/core/following.ts: a push to the parent default branch fast-forwards each covered fork, and fastForwardFork appends a push event on the fork repo with payload.followed set. The wait subscribes before the Next commit and unsubscribes after, uses no timer, and is the same event the production code announces, so it removes the race that moved the fork tip between the two reads. Direction fit: this is the pipeline-first flake class (a green main), and it is small and single-purpose.
Two things I would do next:
- If the follow ever does not fire for that fork (for example a fork-follow mode default change, or the fork not covered by the parent),
await landedhangs until the 60 s beforeAll timeout and the failure says nothing useful. Race it against a bounded wait that throws "the follow never announced a push for <name>", without a Bun.sleep poll since the gate refuses that, or assert the fork mode explicitly. - Call off() in a finally so a throw in commit does not leave the subscriber attached.
- If the follow ever does not fire for that fork (for example a fork-follow mode default change, or the fork not covered by the parent),
-
Checks
shipped production is serving it deploy 93c7c3d
-
History
- take-expect: wait on the follow's own push event, not a timer 070a5e7
- take-expect: let the forge's background follow land before the tests read fork tips ecc57c4
- A .wasm module lists its sections, imports and exports (#14467) 4db7bcb
- A fork's page says in one sentence how far it is from its upstream and what following would do (#14477) b5e17d0
- A wave's page has a share card: title and description tags drawn from its milestone, so the link unfurls (#14473) 74eea2e
- Each maintenance finding on /maintenance links to the issue or pull it opened (#14472) 92936a7
- A photo's camera, lens, exposure and capture time are listed beside the image (#14466) 1282269
- /templates shows how many forges each template started and its newest start (#14475) 9382a03
- A .wav file shows its waveform, drawn on the server beside the player (#14465) d5b83cd
- A Gerber .gbr file draws its copper layer as an SVG (#14468) ef11bd4
- A Collada .dae file opens in the 3D viewer, drawn from its mesh (#14469) 23f1189
- Sentinel: memory-growth was degraded 877 minutes today: The forge's own memory is 2911 MiB, over twice its first-hour 1420 MiB; worker pages's malloc grew most (1338 MiB to 35… (#14446) 1b66953
- The rosters: generate the palette roster from one file per member (child of #14248) (#14443) e86166d
- Full suite red: 3 files in check run 01m7v3ym5xyy8mbv5cnzwcfm7d (#14442) fbb7117
- Sentinel: memory-growth was degraded 837 minutes today: The forge's own memory is 3299 MiB, over twice its first-hour 1420 MiB; worker raster's malloc grew most (974 MiB to 32… (#14433) a4150a0
- The rosters: generate the page budget roster from one file per member (child of #14248) (#14438) 09396bc
- The rosters: generate the route table roster from one file per member (child of #14248) (#14439) f9568b7
- The rosters: generate the MCP doc roster from one file per member (child of #14248) (#14440) 60a5871
- The rosters: generate each shared roster from one file per member (child of #14248) (#14385) a21e18a
- Every page's `rel=alternate` link to /api/v1/here answers, not 404 (#14426) e8a2a93
The flaky test is fixed in test/take-expect.test.ts. I ran it three times in a row with all tests passing, and tsc and scripts/gate.ts --fix are clean.
Cause: in the test setup, Alice commits "Next" to each repo, and the forge's own follow then fast-forwards Bob's fork in the background. On a slow check machine that follow was still running when "a fast-forward applies the previewed id…" read the fork's tip, so it moved Bob's ff fork between before and the assertion. The test then read the fork's tip as changed even though the code under test was fine.
Change: the setup now subscribes to the bus before each "Next" commit and waits for the push event the follow announces for that fork. Nothing moves a fork in the background after that point. It uses no timer and no change to src/.
Not done: I didn't touch the follow code or the other tests in the file, since only this one was named. Only the ff test is named in the failures; the lib tests read their fork's tip twice too, and the same wait covers them.
Process note: my first push went out before the gate had passed, with a Bun.sleep poll that the gate rejects. The second commit replaced it, and the branch's final state passes the gate.
Try it: bun test test/take-expect.test.ts.
This fixes the flaky test "a fast-forward applies the previewed id: a parent that moved after it is not taken" in test/take-expect.test.ts.
Cause: the test setup commits "Next" to each parent repo, and after each one the forge's own follow fast-forwards the fork in the background. On a busy check machine that follow could still be running when the test read the fork's tip twice. It then moved the fork between the two reads, and the assertion at line 112 failed even though fastForwardFork was correct.
Change: before each "Next" commit, the setup now listens on the bus for the push event the follow announces for that fork, and waits for it. After that nothing moves a fork in the background, so the test passes or fails only on the code under test. No timer is involved and src/ is unchanged. The same wait covers the lib fork, whose tests also read its tip twice.
Left out: I didn't change the follow code or the other tests in the file; only this test failed.
Checks: the test file passed three runs in a row, and bun x tsc --noEmit and bun scripts/gate.ts --fix are clean. The first commit waited with a Bun.sleep poll, which the gate's "a test does not wait on a real timer" rule refuses; the second commit replaces it with the bus wait.
Try it: bun test test/take-expect.test.ts.
🤖 Generated with Claude Code
The flaky test is fixed in
test/take-expect.test.ts. I ran it three times in a row with all tests passing, andtscandscripts/gate.ts --fixare clean.Cause: in the test setup, Alice commits "Next" to each repo, and the forge's own follow then fast-forwards Bob's fork in the background. On a slow check machine that follow was still running when "a fast-forward applies the previewed id…" read the fork's tip, so it moved Bob's
fffork betweenbeforeand the assertion. The test then read the fork's tip as changed even though the code under test was fine.Change: the setup now subscribes to the bus before each "Next" commit and waits for the
pushevent the follow announces for that fork. Nothing moves a fork in the background after that point. It uses no timer and no change tosrc/.Not done: I didn't touch the follow code or the other tests in the file, since only this one was named. Only the
fftest is named in the failures; thelibtests read their fork's tip twice too, and the same wait covers them.Process note: my first push went out before the gate had passed, with a
Bun.sleeppoll that the gate rejects. The second commit replaced it, and the branch's final state passes the gate.Try it:
bun test test/take-expect.test.ts.Closes #14513