Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:3tgtaj5heo was degraded 21 minutes today: trevato/forge: "origins on the web > Mirror starts a job, shows its stages, and lands on the mirror" failed on 3 pulls … #6995
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/6986-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork 1 thread · 1 unresolved
1 file
changed +15
−1
test/web-origins.test.ts +15 −1
| @@ -24,6 +24,7 @@ import { listPins } from "../src/core/pins.ts"; | ||
| 24 | 24 | import { getRepo } from "../src/core/repos.ts"; |
| 25 | 25 | import { getUserByName } from "../src/core/users.ts"; |
| 26 | 26 | import { forgetProviders } from "../src/origins/providers/index.ts"; |
| 27 | import { firstFetchRetry } from "../src/origins/mirror.ts"; | |
| 27 | 28 | import { advance, createJob, settled } from "../src/origins/jobs.ts"; |
| 28 | 29 | import { icon } from "../src/web/ui.ts"; |
| 29 | 30 | import { quietLogs, withoutEnv } from "./helpers/globals.ts"; |
| @@ -420,6 +421,19 @@ describe("origins on the web", () => { | ||
| 420 | 421 | }); |
| 421 | 422 | |
| 422 | 423 | test("Mirror starts a job, shows its stages, and lands on the mirror", async () => { |
| 424 | // The first fetch is retried on the forge's clock (2 s, 5 s, 10 s); a | |
| 425 | // loaded check machine can spend all three and fail the job. Retry on a | |
| 426 | // short clock instead, so the verdict is the mirror's, not the load's. | |
| 427 | const found = firstFetchRetry.ms; | |
| 428 | firstFetchRetry.ms = Array.from({ length: 40 }, () => 250); | |
| 429 | try { | |
| 430 | await mirrorStartsAJob(); | |
| 431 | } finally { | |
| 432 | firstFetchRetry.ms = found; | |
| 433 | } | |
| 434 | }); | |
| 435 | ||
| 436 | async function mirrorStartsAJob(): Promise<void> { | |
| 423 | 437 | const id = listOrigins(app.db, getUserByName(app.db, "alice")!.id)[0]!.id; |
| 424 | 438 | const mirrored = await asUser(alice, `/settings/origins/${id}/mirror`, { |
| 425 | 439 | form: { fullName: "octo/widgets" }, |
| @@ -449,7 +463,7 @@ describe("origins on the web", () => { | ||
| 449 | 463 | const after = await (await asUser(alice, jobPath)).text(); |
| 450 | 464 | expect(after).not.toContain("http-equiv"); |
| 451 | 465 | expect(after).toContain("Open the mirror"); |
| 452 | }); | |
| 466 | } | |
| 453 | 467 | |
| 454 | 468 | test("a running job's stream sends the next stage, then done with the mirror's address; only its starter may read it", async () => { |
| 455 | 469 | const id = listOrigins(app.db, getUserByName(app.db, "alice")!.id)[0]!.id; |
new above
offline
Nit: 40 x 250 ms is a 10 s ceiling that the test never reaches when the fetch works. A short comment tying it to the
settledwait would show the two budgets are meant to match.fastFirstFetchin test/helpers/globals.ts already does the save and restore, so you may not need this wrapper.