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

Flaky test: the crew's concurrency and shard count reach the next pick > raised from one to two at boot's one, two agents run at once; each shell is told the shards #16016

Merged opened this in answer to

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

Merged

I fixed the flaky test in test/capacity.test.ts. The "raised from one to two at boot's one" test now releases the held agents only once two are running at once. Cause: the old loop released the held fake agents after 100 samples (about 2 s) in which exactly one agent was running.

Notes

shipped production is serving it deploy 3fede26

opened this

I fixed the flaky test in test/capacity.test.ts. The "raised from one to two at boot's one" test now releases the held agents only once two are running at once.

Cause: the old loop released the held fake agents after 100 samples (about 2 s) in which exactly one agent was running. On a slow machine the second agent could start later than that. The first was then released early, the two never overlapped, and the test failed with most = 1.

Change: I removed the alone counter. The fake agents now release only when most === 2. If the raise were ignored, one agent would hold until the loop's existing 30 s deadline and the test would still fail with most: 1. The comment in the test says why.

Not done: the failure now takes 30 s to show instead of about 2 s. I left the deadline alone, and I didn't try to reproduce the flake, since it depends on a slow machine.

Checks: that one test passes here (7.3 s), bun x tsc --noEmit is clean, and bun scripts/gate.ts --fix ran and changed nothing. I didn't run the rest of the suite; the forge runs the full check on push.

Try it: bun test test/capacity.test.ts -t "raised from one to two at boot"

Closes #16001

commented

I fixed the flaky test in test/capacity.test.ts. The "raised from one to two at boot's one" test now releases the held agents only once two are running at once.

Cause: the old loop released the held fake agents after 100 samples (about 2 s) in which exactly one agent was running. On a slow machine the second agent could start later than that. The first was then released early, the two never overlapped, and the test failed with most = 1.

Change: I removed the alone counter. The fake agents now release only when most === 2. If the raise were ignored, one agent would hold until the loop's existing 30 s deadline and the test would still fail with most: 1. The comment in the test says why.

Not done: the failure now takes 30 s to show instead of about 2 s. I left the deadline alone, and I didn't try to reproduce the flake, since it depends on a slow machine.

Checks: that one test passes here (7.3 s), bun x tsc --noEmit is clean, and bun scripts/gate.ts --fix ran and changed nothing. I didn't run the rest of the suite; the forge runs the full check on push.

Try it: bun test test/capacity.test.ts -t "raised from one to two at boot"

Approved

Test-only fix, and it is the right one. The early release after 100 solo samples is gone, so a slow machine starting the second agent late can no longer read as a refused raise. A real regression still fails on most = 1 at the 30 s deadline. That is well inside the 60 s test timeout, so the failure stays an assertion with the per-run log in seen, not a timeout. No product code, dependency, README or page is touched, so the security, terminal and both-doors items do not apply. Next: (1) the comment line ending "The test does" runs long and the sentence wraps oddly. Re-run bun scripts/gate.ts --fix or rewrap it by hand. (2) If the 30 s failure latency annoys, have the loop stop early once the first agent has ended or errored with the second never started, since that is a real verdict and not a slow start.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs