Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:253591l30d is past its budget: trevato/forge: "RepoSource: one repository, two places to read it from > a mirror reports its stages in order and ends … #7713
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/7685-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork 1 thread · 1 unresolved
1 file
changed +10
−4
test/view-source.test.ts +10 −4
| @@ -55,6 +55,12 @@ const text = (body: Uint8Array): string => new TextDecoder().decode(body); | ||
| 55 | 55 | // A fetch that fails should say so now, not after the forge's patience. |
| 56 | 56 | fastFirstFetch(); |
| 57 | 57 | |
| 58 | // A test that runs a whole mirror spawns real git against a second forge and | |
| 59 | // then imports: ~0.2 s idle, past 2 s on a machine three times oversubscribed. | |
| 60 | // Bun's 5 s default would make the verdict a measure of the check machine's | |
| 61 | // load; what these tests judge is the order and the outcome, not the speed. | |
| 62 | const MIRROR_MS = 60_000; | |
| 63 | ||
| 58 | 64 | describe("RepoSource: one repository, two places to read it from", () => { |
| 59 | 65 | let dataDir: string; |
| 60 | 66 | let originDataDir: string; |
| @@ -578,7 +584,7 @@ describe("RepoSource: one repository, two places to read it from", () => { | ||
| 578 | 584 | ); |
| 579 | 585 | // And they carried something to read: "2 labels", "1 issue", … |
| 580 | 586 | expect(seen).toContain("issues"); |
| 581 | }); | |
| 587 | }, MIRROR_MS); | |
| 582 | 588 | |
| 583 | 589 | test("mirroring busts what the browse cache believed", async () => { |
| 584 | 590 | const source = live("octo/widgets"); |
| @@ -619,7 +625,7 @@ describe("RepoSource: one repository, two places to read it from", () => { | ||
| 619 | 625 | >("SELECT COUNT(*) AS n FROM repo WHERE origin_full_name = ?1") |
| 620 | 626 | .get("octo/ghost")!.n, |
| 621 | 627 | ).toBe(1); |
| 622 | }); | |
| 628 | }, MIRROR_MS); | |
| 623 | 629 | |
| 624 | 630 | test("a failed fetch lands in the job and in fetch_error, scrubbed", async () => { |
| 625 | 631 | const job = await settled( |
| @@ -648,7 +654,7 @@ describe("RepoSource: one repository, two places to read it from", () => { | ||
| 648 | 654 | .get("octo/ghost")!; |
| 649 | 655 | expect(row.fetch_error).not.toBe(""); |
| 650 | 656 | expect(row.fetch_error).not.toContain(ORIGIN_TOKEN); |
| 651 | }); | |
| 657 | }, MIRROR_MS); | |
| 652 | 658 | |
| 653 | 659 | // ---- the equivalence that makes the interface worth having ---- |
| 654 | 660 | |
| @@ -1004,7 +1010,7 @@ describe("RepoSource: one repository, two places to read it from", () => { | ||
| 1004 | 1010 | }) |
| 1005 | 1011 | ).status, |
| 1006 | 1012 | ).toBe(404); |
| 1007 | }); | |
| 1013 | }, MIRROR_MS); | |
| 1008 | 1014 | |
| 1009 | 1015 | test("the process-wide cache is the one the sources use", async () => { |
| 1010 | 1016 | clearViewCache(); |
new above
offline
Fine as a stopgap. Consider a smaller number (e.g. 20 s) so a hung mirror fails in a useful time, and tie it to #1242 when that lands.