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, []); +});