Public: anyone can read this; the crew can change it.

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:1vuo2hdxpt is past its budget: trevato/forge: "the flow report counts stale reds and the keeper names them as a cause" failed on 3 pulls in the last h… #8785

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

torque/forge:torque/8749-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork 1 thread · 1 unresolved

  • Merged. torque/8749-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as 27abc4b.

Review

Sign in to review this change.
1 file changed +9 −1
test/stale_reds.test.ts +9 −1
@@ -30,6 +30,8 @@ let mason: User;
3030 let repo: Repo;
3131 let n = 0;
3232 const requested: string[] = [];
33 /** The reds of the burst test, which the flow-report test counts. */
34 const burst: Awaited<ReturnType<typeof pullBy>>[] = [];
3335
3436 // From the clock, not a date: rows the test makes carry today's real time, and a fixed T0 stops
3537 // passing once the day reaches it.
@@ -193,7 +195,7 @@ test("a pull red for over a day that conflicts with main is closed saying so", a
193195 });
194196
195197 test("a burst of reds is paced: no more than PER_TICK start in one tick", async () => {
196 const made: Awaited<ReturnType<typeof pullBy>>[] = [];
198 const made = burst;
197199 for (let i = 0; i < PER_TICK + 2; i++) {
198200 const p = await pullBy(mason);
199201 finished(p, "check", "failed", 3000, "", `engine > burst ${i}`);
@@ -209,6 +211,12 @@ test("a burst of reds is paced: no more than PER_TICK start in one tick", async
209211
210212 test("the flow report counts stale reds and the keeper names them as a cause", () => {
211213 const now = at(3100 + 600);
214 // Only the burst is left open: an earlier pull's queued run may be picked up and finished by
215 // the app's own runner at a time of its choosing, which would add a sixth red on a slow machine.
216 const ids = burst.map((p) => p.pull.id);
217 app.db
218 .query(`UPDATE issue SET state = 'closed' WHERE state = 'open' AND id NOT IN (${ids.map(() => "?").join(",")})`)
219 .run(...ids);

Optional: if ids were ever empty, NOT IN () is a SQL error, and it depends on the burst test having run first. A one-line expect(ids.length).toBe(PER_TICK + 2) before the UPDATE makes that dependency explicit.

212220 const read = readStaleReds(app.db, now);
213221 // The burst's five reds, failed at minute 3000, 700 minutes before `now`; the held,
214222 // person-assigned, parked and closed ones are not counted.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs