The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Hosted runs: a run's hold asks to stay open as long as the run may take
Adarsh682e19152bc2
diff --git a/docs/admin-api.md b/docs/admin-api.mdindex 9bbadbbd..cd435f4a 100644--- a/docs/admin-api.md+++ b/docs/admin-api.md@@ -111,8 +111,8 @@ Times are epoch milliseconds and sizes are bytes. Every answer is `Cache-Control| `GET /api/admin/files/{path}` | `Range` works | the file; 404 for the owner's own files (held or not) and unknown paths || `GET /api/admin/reports` | `limit` (1 to 500, default 100) | `{ items }`, newest first || `GET /api/admin/queue` | | `{ lanes }` |-| `GET /api/admin/queue/settings` | | `{ settings: { runCeilingS: { default, lanes }, ownerWaitLimitS, fairShare, pickAllowanceMs } }` ([gpu-workers.md](gpu-workers.md#the-queue)) |-| `PATCH /api/admin/queue/settings` | any of `runCeilingS: { default, lanes? }` (seconds, 60 to 86400; a given `runCeilingS` replaces the default and every lane's value), `ownerWaitLimitS` (seconds, 60 to 604800, or `null` for no limit), `fairShare` (boolean), `pickAllowanceMs` (0 to 3600000) | `{ settings }`; 400 with the reason for a value out of bounds, an unknown setting or an unknown lane |+| `GET /api/admin/queue/settings` | | `{ settings: { runCeilingS: { default, lanes }, ownerWaitLimitS, fairShare, pickAllowanceMs, pausedBudgetS } }` ([gpu-workers.md](gpu-workers.md#the-queue)) |+| `PATCH /api/admin/queue/settings` | any of `runCeilingS: { default, lanes? }` (seconds, 60 to 86400; a given `runCeilingS` replaces the default and every lane's value), `ownerWaitLimitS` (seconds, 60 to 604800, or `null` for no limit), `fairShare` (boolean), `pickAllowanceMs` (0 to 3600000), `pausedBudgetS` (seconds, 0 to 604800) | `{ settings }`; 400 with the reason for a value out of bounds, an unknown setting or an unknown lane || `GET /api/admin/workers` | | `{ workers, lanes }` || `POST /api/admin/workers` | `{ name, pool? }` | 201 `{ id, token }`: the worker's token, once || `PATCH /api/admin/workers/{id}` | any of `paused`, `pauseNow`, `drain`, `autoResume`, `hours`, `allow`, `claimAfterMs`, `switchAfterMs`, `rotate` (needs `workers:tokens`), `revoke` | `{ worker, token? }`: a new worker token after `rotate`, once |diff --git a/docs/billing-hook.md b/docs/billing-hook.mdindex d460f4a6..66caa080 100644--- a/docs/billing-hook.md+++ b/docs/billing-hook.md@@ -116,7 +116,7 @@ GPUs wait until it answers again.| Call | Request | Answer ||---|---|---|| `POST /v1/quote` | `{ account: AccountFacts \| null, run: RunFacts, queue: QueueFacts \| null }` | `Quote` |-| `POST /v1/reserve` | `{ requestId, account: AccountFacts, run: RunFacts, queue: QueueFacts \| null, shown: { amount, priceVersion } }` | `{ ok: true, holdId, amount, boostMs, maxWaitMs, pools?, class?, text }` or `{ ok: false, code: RefuseCode \| "price-changed", text, quote?, action?, offer? }` |+| `POST /v1/reserve` | `{ requestId, account: AccountFacts, run: RunFacts, queue: QueueFacts \| null, shown: { amount, priceVersion }, timing?: { runMs, pausedMs } }` | `{ ok: true, holdId, amount, boostMs, maxWaitMs, pools?, class?, text }` or `{ ok: false, code: RefuseCode \| "price-changed", text, quote?, action?, offer? }` || `POST /v1/release` | `{ holdId, reason: "not-created" }` | `{ ok: true }` || `POST /v1/settle` | `{ holdId, generationId, rows, status: "succeeded", final: { outputs, megapixels, seconds }, providerUsd, gpuMs, device, reachedProvider }` | `{ ok: true, charged }` || `POST /v1/refund` | `{ holdId, generationId, rows, status: "failed" \| "canceled" \| "hidden" \| "unchecked", reason, reachedProvider, gpuMs, device }` | `{ ok: true, text }` |@@ -140,6 +140,12 @@ charged" only when its reserve answer set an amount aside (`amount` above 0). `min line before a GPU first takes it; past it the row fails and is refunded. Once a GPU has taken it, the limit is over:a run that goes back in line (a GPU paused or restarted) keeps its place and waits there.+`timing` says how long the hold must stay open after a GPU first takes the run, so the run's reports always come+before the hold's deadline. `runMs` gives every job of every step all its attempts, each at its lane's run ceiling+with the time to send its files and results. `pausedMs` is the time a started run may spend back in line (the queue's+`pausedBudgetS`, two hours unless the owner sets another). A service sets the deadline to at least now + `maxWaitMs` ++`runMs` + `pausedMs`. A run past it still delivers its result. A service that doesn't read `timing` keeps its own rule.+`class` puts the run in a class of the line: `"paid"` runs go before `"free"` ones (no `class`: `"free"`). Theinstall's own jobs come after both. `boostMs` is a head start inside the class, at most a day: the run stands in line asif it had come that much earlier. Both are kept for every row of the run, and a browser never sees them.diff --git a/docs/gpu-workers.md b/docs/gpu-workers.mdindex a1cbffa3..041d03c9 100644--- a/docs/gpu-workers.md+++ b/docs/gpu-workers.md@@ -328,6 +328,7 @@ in that class came.| `ownerWaitLimitS` | How long the owner's own jobs may wait before a worker first takes them, in seconds. `null`: no limit | `null` || `fairShare` | Each class goes round its accounts (above). Off: strict order | `false` || `pickAllowanceMs` | How long a job in a worker's warm lane may go ahead of an older one (above). 0: strict order | `0` |+| `pausedBudgetS` | How long, in all, a run that has started may spend back in line while its worker steps aside, and still be inside the deadline its hold asks for ([billing-hook.md](billing-hook.md)). A run past it still delivers its result | `7200` (2 hours) |A worker's run limit for one attempt is 3 times the lane's 90th percentile on that worker plus its model load, atleast 10 minutes and never past the lane's run ceiling. With no measured run in the lane yet, it is the ceiling.diff --git a/src/app/api/admin/queue/settings/route.ts b/src/app/api/admin/queue/settings/route.tsindex 39dbf543..605f8fbe 100644--- a/src/app/api/admin/queue/settings/route.ts+++ b/src/app/api/admin/queue/settings/route.ts@@ -17,7 +17,7 @@ export async function GET(request: Request) {/*** Change them (owner only, or an admin token with queue:write): any of `{ runCeilingS: { default, lanes },- * ownerWaitLimitS, fairShare, pickAllowanceMs }`. A given runCeilingS replaces the default and every lane's value. Each+ * ownerWaitLimitS, fairShare, pickAllowanceMs, pausedBudgetS }`. A given runCeilingS replaces the default and every lane's value. Each* change is written to the admin log with the values before and after. It applies to new claims and clocks at once.*/export async function PATCH(request: Request) {diff --git a/src/server/billing.ts b/src/server/billing.tsindex bd978a93..48b81724 100644--- a/src/server/billing.ts+++ b/src/server/billing.ts@@ -317,12 +317,27 @@ export async function quote(account: AccountFacts | null, run: RunFacts, queue:*/export const RESERVE_RETRY = { forMs: 60_000, firstMs: 500, mostMs: 8_000 };+/** What a reserve sends (docs/billing-hook.md). */+export interface ReserveInput {+ requestId: string;+ account: AccountFacts;+ run: RunFacts;+ queue: QueueFacts | null;+ shown: { amount: number; priceVersion: string };+ /**+ * How long the run's hold must stay open once a worker first takes the run, so its report always comes before the+ * hold's deadline: `runMs`, every attempt of every job at its lane's run ceiling, and `pausedMs`, the time a started+ * run may spend back in line. The service adds the run's wait limit (`maxWaitMs`) before the first start.+ */+ timing?: { runMs: number; pausedMs: number };+}+/*** Set the run's price aside before it is created. No service: null (no hold; the run is free). The service down: tried* again with the same request id (RESERVE_RETRY: the service makes one hold for it however often it hears it), then a* `paused` refusal in plain words. Never throws.*/-export async function reserve(input: { requestId: string; account: AccountFacts; run: RunFacts; queue: QueueFacts | null; shown: { amount: number; priceVersion: string } }): Promise<ReserveAnswer | null> {+export async function reserve(input: ReserveInput): Promise<ReserveAnswer | null> {if (!billingConfigured()) return null;const start = Date.now();for (let attempt = 0; ; attempt++) {diff --git a/src/server/hosted-run.ts b/src/server/hosted-run.tsindex af4b23a9..9b768288 100644--- a/src/server/hosted-run.ts+++ b/src/server/hosted-run.ts@@ -28,7 +28,8 @@ import { getModel } from "@/lib/catalog";import { PLACE_ASK_HEADER } from "@/lib/guest-access";import { createGenerations, outputKind, plannedSteps, previewGeneration, type PlannedStep } from "./generations";import { loadIndex } from "./gpu/index-file";-import { poolLane } from "./computer/pool";+import { attemptLimitMs, MAX_ATTEMPTS, poolLane } from "./computer/pool";+import { holdTiming } from "./queue-settings";import { HOSTED_GUEST_WORDS, HOSTED_WORDS, inputCounts, poolAllows, poolAllowsRun, poolAway, poolOnWorkers, poolReady, poolRunsProvider, poolTakes, poolTakesFiles, POOL_LANE, queueFacts, runFacts, runOnPool, workflowPicks } from "./hosted";import { withRunStamp } from "./run-stamp";import { hostedRunsOn } from "./hosted-switch";@@ -414,12 +415,16 @@ export async function reservePool(const base: RunStamp = { place: "pool", ...(checkOutputs && { checkOutputs: true }) };if (!billingConfigured()) return { ok: true, stamp: base };const kind = outputKind(planned.op, planned.model);+ const run: RunFacts = { ...runOnPool(account.id, () => runFacts(req, planned, kind)), ...(steps?.length && { steps }) };const a = await reserve({requestId: nanoid(16),account: accountFacts(account),- run: { ...runOnPool(account.id, () => runFacts(req, planned, kind)), ...(steps?.length && { steps }) },+ run,queue: queueFacts(account.id, planned.route.endpoint),shown: shown ?? { amount: 0, priceVersion: "" },+ // How long its hold must stay open once a worker first takes it: every attempt at its lanes' run ceilings, and the+ // time it may spend back in line (the queue's settings).+ timing: holdTiming(run.steps?.length ? run.steps : [{ lane: run.lane, jobs: run.jobs }], MAX_ATTEMPTS, attemptLimitMs),});if (!a) return { ok: true, stamp: base };if (!a.ok) {diff --git a/src/server/queue-settings.ts b/src/server/queue-settings.tsindex a54182d2..67fb5c33 100644--- a/src/server/queue-settings.ts+++ b/src/server/queue-settings.ts@@ -12,6 +12,9 @@ import { db } from "./db";* next job goes after every other account's job that came before it and is the first of its own.* - `pickAllowanceMs`: how long a job in the lane a worker has loaded may go ahead of an older one in another lane, so a* worker doesn't reload its models for every job (0: strict order).+ * - `pausedBudgetS`: how long, in all, a run that has started may spend back in line while its worker steps aside (another+ * program on its GPU, a pause) and still be inside its hold's deadline. With the run ceiling, it sets the time a run+ * asks its hold to stay open (holdTiming). A run past it still delivers its result.** Kept in the settings table under one key, as JSON. Nothing set: the defaults, which are today's fixed values.*/@@ -21,15 +24,17 @@ export interface QueueSettings {ownerWaitLimitS: number | null;fairShare: boolean;pickAllowanceMs: number;+ pausedBudgetS: number;}-export const QUEUE_DEFAULTS: QueueSettings = { runCeilingS: { default: 2700, lanes: {} }, ownerWaitLimitS: null, fairShare: false, pickAllowanceMs: 0 };+export const QUEUE_DEFAULTS: QueueSettings = { runCeilingS: { default: 2700, lanes: {} }, ownerWaitLimitS: null, fairShare: false, pickAllowanceMs: 0, pausedBudgetS: 7200 };/** The bounds each value may take. */export const QUEUE_BOUNDS = {ceilingS: { min: 60, max: 24 * 3600 },ownerWaitS: { min: 60, max: 7 * 24 * 3600 },pickAllowanceMs: { min: 0, max: 3_600_000 },+ pausedBudgetS: { min: 0, max: 7 * 24 * 3600 },lanes: 200,};@@ -74,7 +79,7 @@ const inRange = (v: unknown, b: { min: number; max: number }): v is number => whexport function checkQueuePatch(body: unknown, base: QueueSettings = queueSettings()): { settings: QueueSettings } | { error: string } {if (!body || typeof body !== "object" || Array.isArray(body)) return { error: "Send the settings as an object" };const b = body as Record<string, unknown>;- const known = ["runCeilingS", "ownerWaitLimitS", "fairShare", "pickAllowanceMs"];+ const known = ["runCeilingS", "ownerWaitLimitS", "fairShare", "pickAllowanceMs", "pausedBudgetS"];const unknown = Object.keys(b).filter((k) => !known.includes(k));if (unknown.length) return { error: `Unknown setting: ${unknown[0]}` };const out = copy(base);@@ -110,6 +115,11 @@ export function checkQueuePatch(body: unknown, base: QueueSettings = queueSettinif (!inRange(b.pickAllowanceMs, p)) return { error: `pickAllowanceMs is ${p.min} to ${p.max}` };out.pickAllowanceMs = b.pickAllowanceMs;}+ if (b.pausedBudgetS !== undefined) {+ const p = QUEUE_BOUNDS.pausedBudgetS;+ if (!inRange(b.pausedBudgetS, p)) return { error: `pausedBudgetS is ${p.min} to ${p.max} seconds` };+ out.pausedBudgetS = b.pausedBudgetS;+ }return { settings: out };}@@ -127,6 +137,22 @@ export function runCeilingMs(lane: string | null | undefined, s: QueueSettings =return (own ?? s.runCeilingS.default) * 1000;}+/**+ * How long a run on this install's GPUs asks its hold to stay open once a worker first takes it (the billing service adds+ * the run's wait limit before that): `runMs`, every job of every step given all its attempts (`attemptMs`: the longest+ * one attempt may take in a lane, from its claim to its results sent, which its run ceiling sets), and `pausedMs`, the+ * time a started run may spend back in line (pausedBudgetS).+ */+export function holdTiming(+ steps: { lane: string | null; jobs: number }[],+ attempts: number,+ attemptMs: (lane: string | null) => number,+ s: QueueSettings = queueSettings(),+): { runMs: number; pausedMs: number } {+ const runMs = steps.reduce((sum, j) => sum + Math.max(1, Math.floor(j.jobs) || 1) * attempts * attemptMs(j.lane), 0);+ return { runMs, pausedMs: s.pausedBudgetS * 1000 };+}+/** How long the owner's own job on the workers may wait for its first start (ms), or undefined for no limit. */export function ownerWaitMs(s: QueueSettings = queueSettings()): number | undefined {return s.ownerWaitLimitS === null ? undefined : s.ownerWaitLimitS * 1000;diff --git a/tests/helpers/standin-billing.ts b/tests/helpers/standin-billing.tsindex 3998fe6f..c726a173 100644--- a/tests/helpers/standin-billing.ts+++ b/tests/helpers/standin-billing.ts@@ -9,8 +9,9 @@** By default every run is free: the quote says "Free" with an amount of 0, and a reserve sets nothing aside. `priced`* gives runs a price (`price` per run). A reserve must name its request (`requestId`, else 400), and a repeated- * reserve with the same request id is the same hold. A hold is kept until its deadline (`closeBy`: the run's wait limit plus `holdLifeMs`); a report after it is- * refused and counted as late.+ * reserve with the same request id is the same hold. A hold is kept until its deadline (`closeBy`: the run's wait limit plus the time the+ * reserve's `timing` asks for, or `holdLifeMs` when it sends none or `readTiming` is off); a report after it is refused+ * and counted as late.*/import fs from "node:fs";import http from "node:http";@@ -52,8 +53,10 @@ export interface StandInBilling {policy: Record<string, unknown>;/** The longest a run may wait before its first start (the reserve's maxWaitMs). */maxWaitMs: number;- /** How long a hold lasts after its run's wait limit. */+ /** How long a hold lasts after its run's wait limit, when the reserve asks for no time of its own. */holdLifeMs: number;+ /** Read the reserve's `timing` (on by default). Off: every hold lasts `holdLifeMs`, as a service with a fixed rule. */+ readTiming: boolean;/** Wait this long before every answer. */slowMs: number;/**@@ -117,6 +120,7 @@ export async function startStandInBilling(o: { socket?: boolean; token?: stringpolicy: JSON.parse(JSON.stringify(FREE_RUNS_POLICY)) as Record<string, unknown>,maxWaitMs: 20 * 60_000,holdLifeMs: 2 * 3_600_000,+ readTiming: true,slowMs: 0,gather: null as StandInBilling["gather"],};@@ -172,7 +176,11 @@ export async function startStandInBilling(o: { socket?: boolean; token?: stringconst shown = (body.shown ?? {}) as { amount?: number };const q = quote();if (q.amount > Number(shown.amount ?? 0)) return json(200, { ok: false, code: "price-changed", text: `It now costs ${q.amount}.`, quote: q });- const h: StandInHold = { id: `hold_${++n}`, requestId, account, amount: q.amount, createdAt: now, closeBy: now + f.maxWaitMs + f.holdLifeMs, released: false, reports: new Map() };+ // The deadline: the run's wait limit, then the time the reserve asks for after its first start (`timing`), else+ // the stand-in's own fixed time.+ const t = (body.timing ?? null) as { runMs?: unknown; pausedMs?: unknown } | null;+ const asked = t && typeof t.runMs === "number" && typeof t.pausedMs === "number" ? t.runMs + t.pausedMs : null;+ const h: StandInHold = { id: `hold_${++n}`, requestId, account, amount: q.amount, createdAt: now, closeBy: now + f.maxWaitMs + (f.readTiming && asked !== null ? asked : f.holdLifeMs), released: false, reports: new Map() };f.holds.set(h.id, h);return ok(h);}diff --git a/tests/pool-line-order.test.ts b/tests/pool-line-order.test.tsindex 997460df..1733543e 100644--- a/tests/pool-line-order.test.ts+++ b/tests/pool-line-order.test.ts@@ -444,18 +444,18 @@ describe("GET and PATCH /api/admin/queue/settings", () => {const ownerCookie = () => `${auth.SESSION_COOKIE}=${auth.createSession().value}`;const audits = () => db().prepare("SELECT * FROM admin_audit WHERE action = 'queue.settings' ORDER BY id").all() as { actor: string; detail_json: string | null; status: number; token_id: string | null }[];- it("the defaults are today's: a 45 minute ceiling, no owner wait limit, strict order", async () => {+ it("the defaults are today's: a 45 minute ceiling, no owner wait limit, strict order, and 2 hours back in line inside a hold", async () => {const res = await settingsRoute.GET(req({ cookie: ownerCookie() }));expect(res.status).toBe(200);expect(res.headers.get("cache-control")).toBe("no-store");- expect(await res.json()).toEqual({ settings: { runCeilingS: { default: 2700, lanes: {} }, ownerWaitLimitS: null, fairShare: false, pickAllowanceMs: 0 } });+ expect(await res.json()).toEqual({ settings: { runCeilingS: { default: 2700, lanes: {} }, ownerWaitLimitS: null, fairShare: false, pickAllowanceMs: 0, pausedBudgetS: 7200 } });});it("the owner changes them; each change is logged with the values before and after", async () => {const lane = allLanes(loadIndex(), sha)[0].lane;- const res = await settingsRoute.PATCH(req({ method: "PATCH", cookie: ownerCookie(), body: { runCeilingS: { default: 3000, lanes: { [lane]: 3600 } }, ownerWaitLimitS: 86_400, fairShare: true } }));+ const res = await settingsRoute.PATCH(req({ method: "PATCH", cookie: ownerCookie(), body: { runCeilingS: { default: 3000, lanes: { [lane]: 3600 } }, ownerWaitLimitS: 86_400, fairShare: true, pausedBudgetS: 3600 } }));expect(res.status).toBe(200);- const want = { runCeilingS: { default: 3000, lanes: { [lane]: 3600 } }, ownerWaitLimitS: 86_400, fairShare: true, pickAllowanceMs: 0 };+ const want = { runCeilingS: { default: 3000, lanes: { [lane]: 3600 } }, ownerWaitLimitS: 86_400, fairShare: true, pickAllowanceMs: 0, pausedBudgetS: 3600 };expect(await res.json()).toEqual({ settings: want });expect(qs.queueSettings()).toEqual(want);const row = audits().at(-1)!;@@ -476,6 +476,8 @@ describe("GET and PATCH /api/admin/queue/settings", () => {{ ownerWaitLimitS: -1 },{ fairShare: "yes" },{ pickAllowanceMs: 1.5 },+ { pausedBudgetS: -1 },+ { pausedBudgetS: 8 * 24 * 3600 },{ somethingElse: 1 },[1, 2],null,diff --git a/tests/recovery-server.test.ts b/tests/recovery-server.test.tsindex f6cee304..2e0e303a 100644--- a/tests/recovery-server.test.ts+++ b/tests/recovery-server.test.ts@@ -130,7 +130,7 @@ beforeEach(async () => {process.env.FUOBE_BILLING_URL = svc.address;process.env.FUOBE_BILLING_TOKEN = svc.token;delete process.env.FUOBE_HOSTED_FREE;- Object.assign(svc, { priced: false, slowMs: 0, gather: null, maxWaitMs: 20 * MIN, holdLifeMs: 105 * MIN, policy: JSON.parse(JSON.stringify(FREE_RUNS_POLICY)) });+ Object.assign(svc, { priced: false, slowMs: 0, gather: null, maxWaitMs: 20 * MIN, holdLifeMs: 105 * MIN, readTiming: true, policy: JSON.parse(JSON.stringify(FREE_RUNS_POLICY)) });await svc.start();await comfy.start();comfy.inner.restart({ stall: false, failNext: undefined, loseNext: 0, steps: 4, stepMs: 20 });@@ -1001,6 +1001,47 @@ describe("the run ceiling per lane", () => {await expectOnce(id, watch, { prompts: 1, place: 1 });});+ it("its hold asks to stay open for the lane's run ceiling and the time back in line: a long run that went back in line still settles against its own hold", async () => {+ clock();+ // A 3 hour lane, and an hour back in line covered. The service's own fixed rule (2 hours after the wait limit) would+ // close the hold before this run ends.+ qs.saveQueueSettings({ ...qs.queueSettings(), runCeilingS: { default: 2700, lanes: { [imageLane()]: 3 * 3600 } }, pausedBudgetS: 3600 });+ const w = standInWorker();+ const { id } = await pressRun();+ const reserve = svc.callsOf("/v1/reserve").at(-1)!.body as { timing?: { runMs: number; pausedMs: number } };+ const attempt = pool.SENDING_MS + 2 * 3 * 3_600_000 + pool.SAVING_MS;+ expect(reserve.timing).toEqual({ runMs: pool.MAX_ATTEMPTS * attempt, pausedMs: 3_600_000 });+ const hold = svc.holds.get(holdOf(id)!)!;+ expect(hold.closeBy - hold.createdAt).toBe(svc.maxWaitMs + pool.MAX_ATTEMPTS * attempt + 3_600_000);+ const watch = watchOf(id);+ comfy.inner.opts.steps = 6;+ comfy.inner.opts.stepMs = 100;+ const d = driver(w);+ // A game takes the GPU 10 minutes in, for 40 minutes: the run goes back in line in its place.+ const stepped = stepAsideWhenRunning(d, watch, "gpu-busy:game.exe", () => pass(10 * MIN, [d], watch));+ await workAll(d);+ expect(stepped()).toBe(true);+ await pass(40 * MIN, [d], watch);+ expect(getGeneration(id)).toMatchObject({ status: "queued", message: POOL_WORDS.inLine, queue: { place: 1 } });+ // Back, it runs for two and a half hours.+ d.pause(null);+ let long = false;+ d.onStep(async (step) => {+ await tick();+ await watch.look();+ if (step === "running" && !long) {+ long = true;+ await pass(150 * MIN, [d], watch);+ }+ });+ await workAll(d);+ expect(long).toBe(true);+ await expectOnce(id, watch, { place: 1 });+ expect(Date.now()).toBeGreaterThan(hold.createdAt + svc.maxWaitMs + svc.holdLifeMs);+ expect(svc.reportsFor(id)).toEqual([{ holdId: hold.id, kind: "settle", status: "succeeded" }]);+ expect(svc.late).toEqual([]);+ });+it("a run past its lane's ceiling is stopped by its worker and put back in line once, with its place kept; past it again, it ends in plain words", async () => {clock();qs.saveQueueSettings({ ...qs.queueSettings(), runCeilingS: { default: 2700, lanes: { [imageLane()]: 600 } } });