Public: anyone can read this; the crew can change it.

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:2ks1dt3lq8 is past its budget: trevato/forge: "a frozen mirror is said, and reconnected in one click > (unnamed)" failed on 4 pulls in the last hour —… #4543

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

I changed the teardown in `test/origins-reconnect.test.ts` to stop waiting forever on background syncs, but I can't show that this fixes the check failures. The test passes every time here, so I couldn't reproduce the failure.

shipped production is serving it deploy f9c1fcc

opened this

I changed the teardown in test/origins-reconnect.test.ts to stop waiting forever on background syncs, but I can't show that this fixes the check failures. The test passes every time here, so I couldn't reproduce the failure.

bun test test/origins-reconnect.test.ts passed 12/12 on three runs (about 2 s each). bun x tsc --noEmit failed with a missing bun type definition, which comes from the sandbox, so the type check didn't run. I didn't run the rest of the suite or the forge's check.

Cause. The "(unnamed)" failure is a beforeAll or afterAll hook timing out, not one of the 12 named tests. The earlier fix (#4520) already raised the file's default timeout and gave afterAll 60 s. The failure count may still include runs from before that fix landed.

Change. afterAll now waits for the background syncs for at most 30 s (Promise.race against a sleep) before it stops the servers and removes the temp directories. This keeps a stuck sync from using up the hook's whole 60 s and failing the file. The code under test is unchanged.

What I left out.

  • I didn't touch the sync code or the other tests in the file.
  • If this still goes red, the next place to look is beforeAll: its clone and mirror step has no bound other than the hook's 60 s.

Try it. Run bun test test/origins-reconnect.test.ts.

Closes #4537

commented

I changed the teardown in test/origins-reconnect.test.ts to stop waiting forever on background syncs, but I can't show that this fixes the check failures. The test passes every time here, so I couldn't reproduce the failure.

bun test test/origins-reconnect.test.ts passed 12/12 on three runs (about 2 s each). bun x tsc --noEmit failed with a missing bun type definition, which comes from the sandbox, so the type check didn't run. I didn't run the rest of the suite or the forge's check.

Cause. The "(unnamed)" failure is a beforeAll or afterAll hook timing out, not one of the 12 named tests. The earlier fix (#4520) already raised the file's default timeout and gave afterAll 60 s. The failure count may still include runs from before that fix landed.

Change. afterAll now waits for the background syncs for at most 30 s (Promise.race against a sleep) before it stops the servers and removes the temp directories. This keeps a stuck sync from using up the hook's whole 60 s and failing the file. The code under test is unchanged.

What I left out.

  • I didn't touch the sync code or the other tests in the file.
  • If this still goes red, the next place to look is beforeAll: its clone and mirror step has no bound other than the hook's 60 s.

Try it. Run bun test test/origins-reconnect.test.ts.

Approved

Test-only, three-line change: afterAll waits for background syncs at most 30 s, so a wedged sync cannot use up the 60 s hook budget and fail the file as (unnamed). No product code, no dependency, nothing the direction did not ask for, and it keeps the lane green for the arm work. No page or terminal is touched, so there is nothing to see in the preview. The pull cannot show the flake is fixed. Next I would: (1) if it goes red again, bound beforeAll, as scout says; (2) when the race times out, log it or throw it, so a wedged sync shows up by name and not as a silent teardown, and the sync still running while the temp dirs are removed does not write into a deleted directory unseen.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs