From 574bd793e764b8fa0d96f51794ee47f1a0263c62 Mon Sep 17 00:00:00 2001 From: Ben Silverstein Date: Fri, 6 Nov 2026 13:30:08 -0500 Subject: [PATCH] fix(gate): skip the wait line for an inherited gate slot [C7] A frozen check that runs pullboard test inside submit inherits the slot and reports admitted with no holders, which crashed submit. Co-Authored-By: Claude Opus 5.5 --- src/gate-wait.js | 4 +++- test/gate-wait-admitted.test.js | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 test/gate-wait-admitted.test.js diff --git a/src/gate-wait.js b/src/gate-wait.js index 62a404c4e3..f7af8c07f1 100644 --- a/src/gate-wait.js +++ b/src/gate-wait.js @@ -8,7 +8,9 @@ export function gateWaitReporter(io) { let last = ''; let warned = false; let held = false; - return ({ holders, position, memory, runnerUnavailable }) => { + return ({ holders = [], position, memory, runnerUnavailable, admitted }) => { + // An inherited gate slot is admitted at once: there is no queue to describe. + if (admitted) return; if (runnerUnavailable) { io.say(`runner ${runnerUnavailable.host} unavailable: ${runnerUnavailable.reason}; until ${runnerUnavailable.until}; requeueing the run`); return; diff --git a/test/gate-wait-admitted.test.js b/test/gate-wait-admitted.test.js new file mode 100644 index 0000000000..659ff7e322 --- /dev/null +++ b/test/gate-wait-admitted.test.js @@ -0,0 +1,12 @@ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { gateWaitReporter } from '../src/gate-wait.js'; + +// A run that inherits its parent's gate slot (a frozen check calling pullboard test inside submit) +// is admitted at once and reports no holders; it must not crash the submit. +test('an admitted run that inherited the gate slot says nothing and does not throw', () => { + const said = []; + const report = gateWaitReporter({ say: (line) => said.push(line) }); + assert.doesNotThrow(() => report({ admitted: true })); + assert.deepEqual(said, []); +});