Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:3tgtaj5heo is past its budget: trevato/forge: "origins on the web > Mirror starts a job, shows its stages, and lands on the mirror" failed on 5 pulls … #10558
Check · Review · Land · Live done — Landed and live in production.
mason/forge:mason/10507-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 3 commits fork
2 files
changed +12
−4
test/packs-up.test.ts +5 −2
| @@ -15,7 +15,7 @@ import { addSubscription } from "../src/core/subscriptions.ts"; | ||
| 15 | 15 | import { checkUpstream } from "../src/actions/upstream_follow.ts"; |
| 16 | 16 | import { getRepoById } from "../src/core/repos.ts"; |
| 17 | 17 | import { getUserByName } from "../src/core/users.ts"; |
| 18 | import { provideMirrorOutboundForTest } from "../src/origins/git-mirror.ts"; | |
| 18 | import { mirrorOutboundForTest, provideMirrorOutboundForTest } from "../src/origins/git-mirror.ts"; | |
| 19 | 19 | import { finishWords, OWNER, prepareOwner } from "../src/packs/up.ts"; |
| 20 | 20 | import { deployCommands } from "../src/packs/words.ts"; |
| 21 | 21 | import { repoDir } from "../src/git/repos.ts"; |
| @@ -203,6 +203,9 @@ describe("the one command, against a fake source", () => { | ||
| 203 | 203 | const dir = repoDir(app.reposRoot, OWNER, a.name); |
| 204 | 204 | // The staged copy is what the check's fetch would have brought. |
| 205 | 205 | git(dir, "fetch", "-q", "--no-tags", src, `+${tip}:refs/upstream-follow/${branch}`); |
| 206 | // Put back what was found, not `{}`: the preload's loopback allowance is | |
| 207 | // what the next file in this shard mirrors from (#10507). | |
| 208 | const found = mirrorOutboundForTest(); | |
| 206 | 209 | provideMirrorOutboundForTest({ allow: ["127.0.0.1"] }); |
| 207 | 210 | try { |
| 208 | 211 | const f = getFollow(app.db, repo.id)!; |
| @@ -214,7 +217,7 @@ describe("the one command, against a fake source", () => { | ||
| 214 | 217 | expect(getFollow(app.db, repo.id)!.behind).toBe(1); |
| 215 | 218 | expect(getFollow(app.db, repo.id)!.tip).toBe(tip); |
| 216 | 219 | } finally { |
| 217 | provideMirrorOutboundForTest({}); | |
| 220 | provideMirrorOutboundForTest(found); | |
| 218 | 221 | server.stop(true); |
| 219 | 222 | } |
| 220 | 223 | }); |
test/web-origins.test.ts +7 −2
| @@ -28,7 +28,7 @@ import { forgetProviders } from "../src/origins/providers/index.ts"; | ||
| 28 | 28 | import { firstFetchRetry } from "../src/origins/mirror.ts"; |
| 29 | 29 | import { advance, createJob, settled } from "../src/origins/jobs.ts"; |
| 30 | 30 | import { icon } from "../src/web/ui.ts"; |
| 31 | import { quietLogs, withoutEnv } from "./helpers/globals.ts"; | |
| 31 | import { mirrorOutbound, quietLogs, withoutEnv } from "./helpers/globals.ts"; | |
| 32 | 32 | import { |
| 33 | 33 | newFakeOAuth, |
| 34 | 34 | newFakeState, |
| @@ -41,6 +41,11 @@ import { spriteAsset } from "../src/web/asset.ts"; | ||
| 41 | 41 | import { adminCookie, seedAdmin } from "./helpers/admin.ts"; |
| 42 | 42 | |
| 43 | 43 | quietLogs(); |
| 44 | // Every mirror here fetches from a loopback origin. Say so in this file rather | |
| 45 | // than lean on the preload: a file before this one in the same shard that left | |
| 46 | // the vet tightened refused every fetch, and the job failed after its retries | |
| 47 | // (#10507). | |
| 48 | mirrorOutbound({ allow: ["127.0.0.1", "::1"] }); | |
| 44 | 49 | |
| 45 | 50 | // Every test here drives a real git fetch and renders real pages; on a loaded |
| 46 | 51 | // check machine the 5 s default measures the machine, not the code. |
| @@ -483,7 +488,7 @@ describe("origins on the web", () => { | ||
| 483 | 488 | |
| 484 | 489 | const jobId = jobPath.split("/").pop()!; |
| 485 | 490 | const done = await settled(jobId); |
| 486 | expect(done?.stage).toBe("done"); | |
| 491 | expect({ stage: done?.stage, error: done?.error }).toEqual({ stage: "done", error: undefined }); | |
| 487 | 492 | expect(getRepo(app.db, "alice", "widgets")).toBeDefined(); |
| 488 | 493 | |
| 489 | 494 | // Finished: no self-refresh loop, a redirect to the mirror instead. |