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

test/merge-queue-check-retry.test.ts passes every time in the full suite, not just alone #7438

Merged opened this

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

Merged

merge-queue-check-retry.test.ts no longer depends on which test files share its process (#7419)

shipped production is serving it deploy b4d876b

opened this

merge-queue-check-retry.test.ts no longer depends on which test files share its process (#7419)

Cause. The log floor in src/kernel/log.ts is one setting for the whole process. seedFixture in bench/map-home.ts sets it to error for the bench command line and never puts it back. test/map-cache.test.ts and test/caching-doc.test.ts call seedFixture. In the check's shard 2, map-cache.test.ts runs just before merge-queue-check-retry.test.ts in the same bun test process. With the floor at error, the queue's log.info("… red (check) named no test, gating once more") was dropped. The gates and answers in the first test were right, but its log assertion (line 83) got false. The check logs of #7412 and #7316 both show that line failing, with "fails only beside others". I reproduced it locally from shard 2's exact file list, and with each of the two leaking files paired with this one.

Changes

  • test/merge-queue-check-retry.test.ts: beforeAll sets the log floor to info and afterAll restores the floor it found, as merge-queue.test.ts already does. No assertion changed, and nothing waits on a timer or a longer timeout.
  • test/map-cache.test.ts and test/caching-doc.test.ts: each calls quietLogs() from test/helpers/globals.ts. The floor is raised for that file and given back to the next one. Before this, every later file in the shard lost its info and warn lines.

Each half fixes the failure alone. I checked both: only this test's change with map-cache still leaking, and only the two leaking files fixed without this test's change. Each was green.

How it was run. Shard 2's exact file list from the failing check, 38 files ending with vision.test.ts, was run with bun test --timeout 60000 <files> 20 times in a row: 20 of 20 green, 246 pass and 0 fail each time. Before the fix the same command failed on the first run. I did not run the whole suite 20 times, because the shard that failed is the case the issue describes and it runs much faster. bun x tsc --noEmit is clean.

Not done

  • src/checks/queue.ts and bench/map-home.ts are unchanged. The queue holds no state across files that mattered here, and the bench sets a quiet floor on purpose for its command line.
  • #7354 is still open, so there was no rebase.
  • The other red in those checks, "report a problem in the terminal > the palette has the row" (shard 5), is a separate failure and is not addressed here.

🤖 Generated with Claude Code

Closes #7419

commented

merge-queue-check-retry.test.ts no longer depends on which test files share its process (#7419)

Cause. The log floor in src/kernel/log.ts is one setting for the whole process. seedFixture in bench/map-home.ts sets it to error for the bench command line and never puts it back. test/map-cache.test.ts and test/caching-doc.test.ts call seedFixture. In the check's shard 2, map-cache.test.ts runs just before merge-queue-check-retry.test.ts in the same bun test process. With the floor at error, the queue's log.info("… red (check) named no test, gating once more") was dropped. The gates and answers in the first test were right, but its log assertion (line 83) got false. The check logs of #7412 and #7316 both show that line failing, with "fails only beside others". I reproduced it locally from shard 2's exact file list, and with each of the two leaking files paired with this one.

Changes

  • test/merge-queue-check-retry.test.ts: beforeAll sets the log floor to info and afterAll restores the floor it found, as merge-queue.test.ts already does. No assertion changed, and nothing waits on a timer or a longer timeout.
  • test/map-cache.test.ts and test/caching-doc.test.ts: each calls quietLogs() from test/helpers/globals.ts. The floor is raised for that file and given back to the next one. Before this, every later file in the shard lost its info and warn lines.

Each half fixes the failure alone. I checked both: only this test's change with map-cache still leaking, and only the two leaking files fixed without this test's change. Each was green.

How it was run. Shard 2's exact file list from the failing check, 38 files ending with vision.test.ts, was run with bun test --timeout 60000 <files> 20 times in a row: 20 of 20 green, 246 pass and 0 fail each time. Before the fix the same command failed on the first run. I did not run the whole suite 20 times, because the shard that failed is the case the issue describes and it runs much faster. bun x tsc --noEmit is clean.

Not done

  • src/checks/queue.ts and bench/map-home.ts are unchanged. The queue holds no state across files that mattered here, and the bench sets a quiet floor on purpose for its command line.
  • #7354 is still open, so there was no rebase.
  • The other red in those checks, "report a problem in the terminal > the palette has the row" (shard 5), is a separate failure and is not addressed here.

🤖 Generated with Claude Code

Approved

Approved. The cause is right: seedFixture (bench/map-home.ts:95) drops the process-wide log floor to error and never puts it back. That hid the queue's info line from merge-queue-check-retry's log assertion whenever map-cache or caching-doc ran before it in the same shard.

Both halves are sound:

  • The two leaking files now call quietLogs() at top level. Its beforeAll records the floor before any test calls seedFixture, since both files call it inside tests or describe hooks, and its afterAll gives the floor back to the next file.
  • The retry test now sets its own info floor and restores it, the same pattern merge-queue.test.ts:205 already uses. No assertion is weakened and no timeout is added.

Security: test-only change, no runtime surface, no secrets, no new dependency. The check is green at 9783a257 and the preview answers / with 200. There is nothing for the terminal or the README to add.

One non-blocking nit is in the line comment.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs