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 #171

Merged opened this

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

Merged

scout/cs:scout/166-the-check-is-red-on-main-and-production → main 1 commit fork

  • Merged. scout/166-the-check-is-red-on-main-and-production was merged into main as 6b43481.

Review

Sign in to review this change.
2 files changed +11 −5
src/client/bots.test.ts +1 −1
@@ -256,7 +256,7 @@ test("the carrier gets the bomb down inside the round clock", () => {
256256 // `scripts/measure.ts` over 177 rounds, before and after the bots could
257257 // hear), and five rounds cannot tell 54% from a bad afternoon.
258258 expect(planted.length).toBeGreaterThanOrEqual(5);
259 });
259 }, 10_000); // ten rounds played out headlessly, twice the default timeout for a slower box
260260
261261 test("a bomb on the floor is still picked up by a living terrorist", () => {
262262 const world = createWorld(RULES, "you", "ct", 1, 4242);
src/client/world.test.ts +10 −4
@@ -638,7 +638,7 @@ test("a match plays itself to the end inside its own time", () => {
638638 expect(world.match.phase).toBe("match_over");
639639 expect(world.match.matchWinner).not.toBe(null);
640640 expect(Math.max(world.match.score.t, world.match.score.ct)).toBe(2);
641 });
641 }, 10_000); // a real playthrough, twice the default timeout for a slower box
642642
643643 test("restoreWorld(snapshot(world, id)) round-trips score, round, money and gear", () => {
644644 const world = createWorld(SHORT, "me", "ct", 5, 301);
@@ -719,9 +719,15 @@ test("a snapshot whose score already reaches winScore is refused: a decided matc
719719 test("past half time, a restored player lands back in their own slot, not the pre-swap one", () => {
720720 const world = createWorld(SHORT, "me", "ct", 5, 777);
721721 const half = halfTime(SHORT);
722 // Play the match out for real — elimination, the bomb, the clock, whatever
723 // ends a round — until the side swap `saved.ts` warns about has happened.
724 for (let t = 0; t < 900 && world.match.round <= half; t += TICK) update(world, TICK, NO_INPUT);
722 // What ends a round — elimination, the bomb, the clock — is `match.ts`'s
723 // business and is proven elsewhere; here it is `rules.tick`'s own timeout
724 // path, forced to fire on the very next tick, so the same `update` code
725 // that flips sides at half time runs for real without playing a round out
726 // to reach it. `world.match.round` is never poked directly.
727 while (world.match.round <= half) {
728 world.match.timer = TICK;
729 update(world, TICK, NO_INPUT);
730 }
725731 expect(world.match.round).toBeGreaterThan(half); // otherwise this test proves nothing
726732
727733 world.me.primary = "awp";

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs