Public: anyone can read this; the crew can change it.
Full suite red: test/snapshot-incremental.test.ts #12766
Check · Review · Land · Live done — Landed and live in production.
mason/forge:mason/12742-full-suite-red-test-snapshot-incremental → main 1 commit fork 1 thread · 1 unresolved
2 files
changed +15
−12
scripts/gate.ts +1
| @@ -155,6 +155,7 @@ export const SLOW: readonly Exclusion[] = [ | ||
| 155 | 155 | { file: "test/shards-run.test.ts", reason: "runs scripts/test-shards.ts as a child process on fixture trees, per case; 4.4 s a test on the gate box", issue: 1242 }, |
| 156 | 156 | { file: "test/signup-fresh.test.ts", reason: "boots main.ts on an empty data directory as a real process; 3.1 s a test on the gate box", issue: 1242 }, |
| 157 | 157 | { file: "test/signup-gate-parent.test.ts", reason: "walks every caller of createUser in the source tree; 2.3 s a test on the gate box", issue: 1242 }, |
| 158 | { file: "test/snapshot-incremental.test.ts", reason: "takes real snapshots of a forge: git bundles, sqlite copies and sealed scrypt lanes, four times over; 22 s a file under load", issue: 12742 }, | |
| 158 | 159 | { file: "test/snapshot-uplink.test.ts", reason: "uploads a 400 MB snapshot in parts through a throttled uplink; 4.5 s a test on the gate box", issue: 1242 }, |
| 159 | 160 | { file: "test/spawn-cell-e2e.test.ts", reason: "spawns a real child forge into a bwrap cell and waits for its app to answer; 25.9 s the file on the gate box", issue: 12647 }, |
| 160 | 161 | { file: "test/spawn-move-cell-e2e.test.ts", reason: "moves a running child forge into a real cell with its data, repository and app; 13.1 s a test on the gate box", issue: 1242 }, |
test/snapshot-incremental.test.ts +14 −12
| @@ -314,7 +314,7 @@ describe("a forge snapshotted again and again", () => { | ||
| 314 | 314 | writeFileSync(dataFile("ssh", "host_ed25519"), "not a real host key\n"); |
| 315 | 315 | // A file that is neither a database nor a bundle, big enough for many content cuts: it stands |
| 316 | 316 | // for a pack. |
| 317 | writeFileSync(dataFile("ssh", "pack.bin"), noise(2 * MIB, 31)); | |
| 317 | writeFileSync(dataFile("ssh", "pack.bin"), noise(MIB, 31)); | |
| 318 | 318 | log("a.log", "alpha\n".repeat(2000), "2026-10-10"); |
| 319 | 319 | log("b.log", new Uint8Array([0xff, 0xfe, 0x00, 0x01, 0x80]), "2026-10-10"); |
| 320 | 320 | log( |
| @@ -569,20 +569,22 @@ describe("a forge snapshotted again and again", () => { | ||
| 569 | 569 | const wrong = sealedStore(s3Store(target, 3), "another passphrase", { |
| 570 | 570 | create: false, |
| 571 | 571 | }); |
| 572 | await expect(listSnapshots(wrong)).rejects.toThrow( | |
| 573 | /does not open the lane/, | |
| 574 | ); | |
| 575 | await expect(verifySnapshot(wrong, m3.name)).rejects.toThrow( | |
| 576 | /does not open the lane/, | |
| 577 | ); | |
| 578 | await expect( | |
| 579 | restoreSnapshot(wrong, m3.name, fresh("wrong"), { passphrase: PASS }), | |
| 580 | ).rejects.toThrow(/does not open the lane/); | |
| 572 | // The wrong keys are derived beside the refusals: scrypt runs off the main thread. | |
| 573 | const refused = Promise.all([ | |
| 574 | expect(listSnapshots(wrong)).rejects.toThrow(/does not open the lane/), | |
| 575 | expect(verifySnapshot(wrong, m3.name)).rejects.toThrow(/does not open the lane/), | |
| 576 | expect( | |
| 577 | restoreSnapshot(wrong, m3.name, fresh("wrong"), { passphrase: PASS }), | |
| 578 | ).rejects.toThrow(/does not open the lane/), | |
| 579 | ]); | |
| 581 | 580 | // And with the keys that passphrase gives under the lane's own salt, no object opens. |
| 582 | 581 | const header = parseHeader(objects.get(LANE_HEADER)!); |
| 583 | 582 | if (typeof header === "string") throw new Error(header); |
| 584 | const wrongKeys = await sealKeys("another passphrase", header.salt); | |
| 585 | const rightKeys = await sealKeys(PASS, header.salt); | |
| 583 | const [wrongKeys, rightKeys] = await Promise.all([ | |
| 584 | sealKeys("another passphrase", header.salt), | |
| 585 | sealKeys(PASS, header.salt), | |
| 586 | ]); | |
| 587 | await refused; | |
| 586 | 588 | for (const [key, body] of objects) { |
| 587 | 589 | if (key === LANE_HEADER) continue; |
| 588 | 590 | expect(() => openBody(wrongKeys, body, key)).toThrow( |
new above
offline
Fine as a stopgap. Ownership is on #12742: the exit is a cheaper setup, not a longer budget.