Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:1uelmre57z is past its budget: trevato/forge: "migrate: after > mirror: the crew's work branches never go to the source" failed on 4 pulls in the last… #4532
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/4528-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 2 commits fork 2 threads · 2 unresolved
1 file
changed +9
−7
test/migrate-after.test.ts +9 −7
| @@ -31,7 +31,9 @@ import { promote } from "./helpers/members.ts"; | ||
| 31 | 31 | |
| 32 | 32 | quietLogs(); |
| 33 | 33 | // Git and a fake forge under a loaded check machine outlast bun's 5 s default. |
| 34 | setDefaultTimeout(30_000); | |
| 34 | // The test's own limit sits above the longest wait inside it (`settledTarget`'s | |
| 35 | // deadline), so a slow push is waited for, never cut off as a timeout. | |
| 36 | setDefaultTimeout(120_000); | |
| 35 | 37 | |
| 36 | 38 | describe("migrate: after", () => { |
| 37 | 39 | let dataDir: string; |
| @@ -113,7 +115,7 @@ describe("migrate: after", () => { | ||
| 113 | 115 | if (!connected.ok) throw new Error(connected.error); |
| 114 | 116 | originId = connected.value.id; |
| 115 | 117 | stopMirror = startMirrorOut(app); |
| 116 | }, 30_000); | |
| 118 | }, 120_000); | |
| 117 | 119 | |
| 118 | 120 | afterAll(async () => { |
| 119 | 121 | // Pushes still running read the database and the repositories: let them |
| @@ -131,7 +133,7 @@ describe("migrate: after", () => { | ||
| 131 | 133 | // directory goes once they let go. A scratch directory that will not go |
| 132 | 134 | // is the machine's to sweep, not a verdict on the code under test. |
| 133 | 135 | await rm(dataDir, { recursive: true, force: true, maxRetries: 40, retryDelay: 100 }).catch(() => {}); |
| 134 | }, 30_000); | |
| 136 | }, 120_000); | |
| 135 | 137 | |
| 136 | 138 | test("the form's word: anything but archive or mirror leaves it alone", () => { |
| 137 | 139 | expect(afterChoice("archive")).toBe("archive"); |
| @@ -184,7 +186,7 @@ describe("migrate: after", () => { | ||
| 184 | 186 | const settledTarget = async (copy: string, ok: (t: NonNullable<ReturnType<typeof getMirrorTarget>>) => boolean) => { |
| 185 | 187 | // A deadline, not a count of naps: a loaded check machine slows the push, |
| 186 | 188 | // never the verdict. |
| 187 | const deadline = Date.now() + 40_000; | |
| 189 | const deadline = Date.now() + 90_000; | |
| 188 | 190 | while (Date.now() < deadline) { |
| 189 | 191 | const held = getMirrorTarget(app.db, getRepo(app.db, "alice", copy)!.id); |
| 190 | 192 | if (held !== undefined && ok(held)) return held; |
| @@ -269,13 +271,13 @@ describe("migrate: after, refused at the boundary", () => { | ||
| 269 | 271 | dataDir = await mkdtemp(join(tmpdir(), "forge-migrate-after-400-")); |
| 270 | 272 | app = createApp({ dataDir, port: 0 }); |
| 271 | 273 | servers = await serve(app); |
| 272 | }, 60_000); | |
| 274 | }, 120_000); | |
| 273 | 275 | |
| 274 | 276 | afterAll(async () => { |
| 275 | 277 | servers.stop(); |
| 276 | 278 | app.close(); |
| 277 | 279 | await rm(dataDir, { recursive: true, force: true, maxRetries: 20, retryDelay: 100 }); |
| 278 | }, 30_000); | |
| 280 | }, 120_000); | |
| 279 | 281 | |
| 280 | 282 | test("POST /api/v1/migrate with an unknown `after` is a 400 naming the three words", async () => { |
| 281 | 283 | const made = await createUser(app.db, { |
| @@ -297,5 +299,5 @@ describe("migrate: after, refused at the boundary", () => { | ||
| 297 | 299 | expect(said).toContain("leave"); |
| 298 | 300 | expect(said).toContain("archive"); |
| 299 | 301 | expect(said).toContain("mirror"); |
| 300 | }, 60_000); | |
| 302 | }, 120_000); | |
| 301 | 303 | }); |
new above
offline
Nit: the limit (120 s) and the deadline at settledTarget (90 s) are separate literals; one shared constant would keep the invariant stated in the comment true by construction.