Public: anyone can read this; the crew can change it.
Full suite red: test/timers-named.test.ts #11990
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/11984-full-suite-red-test-timers-named-test-ts → main 3 commits fork
3 files
changed +7
−3
src/runs/log.ts +2 −1
| @@ -20,6 +20,7 @@ import { | ||
| 20 | 20 | closeSync, |
| 21 | 21 | } from "node:fs"; |
| 22 | 22 | import { join } from "node:path"; |
| 23 | import { during } from "../perf/jobs.ts"; | |
| 23 | 24 | import { redactHeld } from "../kernel/log.ts"; |
| 24 | 25 | import { noteActivity } from "./activity.ts"; |
| 25 | 26 | |
| @@ -146,7 +147,7 @@ function enqueue(dataDir: string, runId: string, clean: string): void { | ||
| 146 | 147 | pendingBytes += clean.length + 1; |
| 147 | 148 | if (pendingBytes >= FLUSH_BYTES) flushRunLogs(); |
| 148 | 149 | else if (flushTimer === undefined) { |
| 149 | flushTimer = setTimeout(flushRunLogs, FLUSH_MS); | |
| 150 | flushTimer = setTimeout(() => void during("run-log-flush", flushRunLogs), FLUSH_MS); | |
| 150 | 151 | flushTimer.unref?.(); |
| 151 | 152 | } |
| 152 | 153 | } |
src/spawn/stopped.ts +3 −2
| @@ -4,6 +4,7 @@ | ||
| 4 | 4 | * backoff and its pages say so instead of "the forge is full". |
| 5 | 5 | */ |
| 6 | 6 | import type { App } from "../app.ts"; |
| 7 | import { during } from "../perf/jobs.ts"; | |
| 7 | 8 | |
| 8 | 9 | export type Stop = { name: string; at: number; why: string; stops: number }; |
| 9 | 10 | |
| @@ -51,7 +52,7 @@ export function noteStop(parent: App, bodyId: string, name: string, why: string, | ||
| 51 | 52 | s.stops.set(bodyId, stop); |
| 52 | 53 | const was = s.timers.get(bodyId); |
| 53 | 54 | if (was !== undefined) clearTimeout(was); |
| 54 | const timer = setTimeout(() => { | |
| 55 | const timer = setTimeout(() => void during("spawn-restart", () => { | |
| 55 | 56 | s.timers.delete(bodyId); |
| 56 | 57 | const restart = s.restart; |
| 57 | 58 | if (restart === undefined) return clearStop(parent, bodyId); |
| @@ -59,7 +60,7 @@ export function noteStop(parent: App, bodyId: string, name: string, why: string, | ||
| 59 | 60 | (coming) => coming || clearStop(parent, bodyId), |
| 60 | 61 | () => clearStop(parent, bodyId), |
| 61 | 62 | ); |
| 62 | }, waitMs ?? backoffMs(stop.stops)); | |
| 63 | }), waitMs ?? backoffMs(stop.stops)); | |
| 63 | 64 | timer.unref?.(); |
| 64 | 65 | s.timers.set(bodyId, timer); |
| 65 | 66 | return stop; |
test/job-slices.test.ts +2
| @@ -241,6 +241,8 @@ const UNTIMED: Record<string, string> = { | ||
| 241 | 241 | probes: "probes each app over HTTP after a deploy and nightly; the fixture has no apps", |
| 242 | 242 | prompts: "a closure in startPromptRoutine; the fixture has no prompt routines", |
| 243 | 243 | timers: "fires due app timers over HTTP to the apps; the fixture has no apps", |
| 244 | "run-log-flush": "a one-shot timer in runs/log.ts that appends buffered lines to the run log files: I/O, no fixture runs", | |
| 245 | "spawn-restart": "a one-shot backoff timer in spawn/stopped.ts that restarts a stopped spawn; the fixture has no spawns", | |
| 244 | 246 | "estimates-due": "settles due 'done' estimates every five minutes from one indexed query on open estimates; the fixture records none", |
| 245 | 247 | snapshot: "copies the database file to disk (VACUUM INTO): I/O off the loop, nightly", |
| 246 | 248 | "snapshot-mirror": "uploads a snapshot to the mirror: network, nightly", |
new above
offline