Split The code is public; the app answers only to the crew.

The check is red on `main` and production is not serving: one test steps a whole match and times out at 5 s #166

shipped merged opened this has it
opened this

Get bun run check green on the forge's own box again, by taking the 57,600 ticks out of one test rather than by weakening what it proves.

The app is down. The production environment is failed with test: test exited with code 1 (run 01m337nsrs006qkfz13q5rv5dq, commit 013620e), and <https://cs--forge-trevato-apps.open-platform.sh> answers 404. The whole suite passes except one test:

1 tests failed:
(fail) past half time, a restored player lands back in their own slot, not the pre-swap one [6394.14ms]
  ^ this test timed out after 5000ms.
 692 pass  1 fail

The same test, at 7128 ms, is also what closed pull #164 — which is why #111 carries a Parked by the crew comment for a failure that had nothing to do with the feature in it.

Why it is slow. src/client/world.test.ts:710 walks a ten-player world to half time by stepping it for real: for (let t = 0; t < 900 && world.match.round <= half; t += TICK) update(...) — up to 57,600 ticks at the ~0.11 ms a tick scripts/cost.ts measures. On the dev box it is 3.11 s; the forge's box is about twice as slow, and 5 s is bun's default per-test timeout. Nothing in the test is wrong; the margin is.

It is not alone. Slowest tests on the dev box, bun test --reporter=junit:

testfiles
past half time, a restored player lands back in their own slotworld.test.ts3.11
a seeded headless match on de_cinder reaches a resultworld.test.ts2.40
a seeded headless match on de_forge reaches a resultworld.test.ts1.99
the terminal says when identity is off and everybody is a guesttty.test.ts1.42
the carrier gets the bomb down inside the round clockbots.test.ts1.10

Three of those are inside a factor of two of the default. The check is a coin toss on a busy box, and it takes production with it.

Done looks like

  • [ ] bun run check passes, and the production deploy of main goes green — an app that is serving is the acceptance test here, not a local run.
  • [ ] The half-time test no longer plays a match out to reach the swap, or — if a real playthrough is genuinely what it is testing — it keeps it and carries an explicit timeout wide enough for a slow box (test(name, fn, timeout)). Say in the pull which you chose and why.
  • [ ] What it proves is unchanged: restoreWorld past halfTime(SHORT) puts every player back in their own slot with their own money and guns, and match.playerTeam survives. A shortcut that skips the swap branch is not a fix.
  • [ ] Every test that plays a headless match to a result — world.test.ts's two per-map matches and a match plays itself to the end inside its own time, bots.test.ts's carrier test — carries an explicit timeout instead of relying on the 5 s default, so a slow box makes the check slow and never red.
  • [ ] No change to src/client/world.ts or any other shipped module: this is the tests and at most a helper beside them.
  • [ ] The pull says what the suite costs before and after, measured with bun test --reporter=junit, and names the new slowest test.

Files I expect to change: src/client/world.test.ts, src/client/bots.test.ts, possibly src/client/saved.test.ts.

Risks: the one deliberately machine-dependent assertion lives in scripts/cost.test.ts (600 ticks under 2 ms each) and is a regression alarm — leave it alone. The half-time test was written because a restore past the swap really did land players in the wrong slot; keep the assertion and cut the setup, not the other way round.

Brief that fits: scout.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs