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

test/snapshot-mirror.test.ts's off-box mirror cases pass every time on a loaded check machine #4624

Merged opened this

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

Merged

scout/forge:scout/4580-test-snapshot-mirror-test-ts-s-off-box-m → main 1 commit fork

  • Merged. scout/4580-test-snapshot-mirror-test-ts-s-off-box-m was merged into main as 12a2b07.

Review

Sign in to review this change.
1 file changed +7 −5
test/snapshot-mirror.test.ts +7 −5
@@ -82,7 +82,8 @@ describe("the off-box mirror", () => {
8282 test("a snapshot lands in both buckets, and the page's facts say so", async () => {
8383 const svc = startSnapshots(app, src(), { version: "t", nightly: false, mirror: dst() });
8484 const m = await svc.now();
85 const state = await svc.mirrorNow();
85 // `now()` starts the upload in the background: a pass begun after it has ended is the one that has seen it land.
86 const state = await svc.mirrorFresh();
8687 expect(state?.reachable).toBe(true);
8788 expect(state?.failingSince).toBeUndefined();
8889 const there = await listSnapshots(dst());
@@ -109,13 +110,14 @@ describe("the off-box mirror", () => {
109110 forgeUrl: "https://forge.example.com",
110111 now: () => clock,
111112 send: async (_u, body) => (sent.push(body), true),
112 clockMs: 20,
113 // Never on its own: each wake below is an event the test sends and awaits.
114 clockMs: 3_600_000,
113115 });
114116 await n.settled();
115117 offbox.down = true;
116118 const svc = startSnapshots(app, src(), { version: "t", nightly: false, mirror: dst() });
117119 await svc.now();
118 const state = await svc.mirrorNow();
120 const state = await svc.mirrorFresh();
119121 expect(state?.reachable).toBe(false);
120122 const line = board(Date.now());
121123 expect(line).toHaveLength(1);
@@ -127,10 +129,10 @@ describe("the off-box mirror", () => {
127129 expect(lastMirror(root)!.failingSince).toBe(first);
128130 expect(board(Date.now())).toHaveLength(1);
129131
130 // The clock wakes the notifier a few times: one push, however many ticks.
132 // The notifier is woken a few times: one push, however many wakes.
131133 for (let i = 0; i < 4; i++) {
132134 clock += 60_000;
133 await Bun.sleep(40);
135 app.bus.append({ kind: "drill.finished", payload: { verdict: "green" } });
134136 await n.settled();
135137 }
136138 await n.close();

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs