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
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/4580-test-snapshot-mirror-test-ts-s-off-box-m → main 1 commit fork
1 file
changed +7
−5
test/snapshot-mirror.test.ts +7 −5
| @@ -82,7 +82,8 @@ describe("the off-box mirror", () => { | ||
| 82 | 82 | test("a snapshot lands in both buckets, and the page's facts say so", async () => { |
| 83 | 83 | const svc = startSnapshots(app, src(), { version: "t", nightly: false, mirror: dst() }); |
| 84 | 84 | 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(); | |
| 86 | 87 | expect(state?.reachable).toBe(true); |
| 87 | 88 | expect(state?.failingSince).toBeUndefined(); |
| 88 | 89 | const there = await listSnapshots(dst()); |
| @@ -109,13 +110,14 @@ describe("the off-box mirror", () => { | ||
| 109 | 110 | forgeUrl: "https://forge.example.com", |
| 110 | 111 | now: () => clock, |
| 111 | 112 | 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, | |
| 113 | 115 | }); |
| 114 | 116 | await n.settled(); |
| 115 | 117 | offbox.down = true; |
| 116 | 118 | const svc = startSnapshots(app, src(), { version: "t", nightly: false, mirror: dst() }); |
| 117 | 119 | await svc.now(); |
| 118 | const state = await svc.mirrorNow(); | |
| 120 | const state = await svc.mirrorFresh(); | |
| 119 | 121 | expect(state?.reachable).toBe(false); |
| 120 | 122 | const line = board(Date.now()); |
| 121 | 123 | expect(line).toHaveLength(1); |
| @@ -127,10 +129,10 @@ describe("the off-box mirror", () => { | ||
| 127 | 129 | expect(lastMirror(root)!.failingSince).toBe(first); |
| 128 | 130 | expect(board(Date.now())).toHaveLength(1); |
| 129 | 131 | |
| 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. | |
| 131 | 133 | for (let i = 0; i < 4; i++) { |
| 132 | 134 | clock += 60_000; |
| 133 | await Bun.sleep(40); | |
| 135 | app.bus.append({ kind: "drill.finished", payload: { verdict: "green" } }); | |
| 134 | 136 | await n.settled(); |
| 135 | 137 | } |
| 136 | 138 | await n.close(); |
new above
offline