stdio (TypeScript): the ask's bound is the setting ask-bound; the pause has a seam (H-A-549)

Review round 1: the bound of asking again while the tool runner is stopping is the
setting ask-bound (default 60 s), and the pause and the clock are askPacing, which
the test replaces as the Go test does pause and askNow, so nothing sleeps. Rows
added: past the bound the fault is the caller's, a bare timeout stays a failure.

Builds: design 47 H2 H-A-542, H-A-544, H-A-549
This commit is contained in:
2026-11-23 12:05:15 +01:00
parent fdb85e8bd5
commit 07bfc71c33
3 changed files with 38 additions and 15 deletions
+9 -4
View File
@@ -379,10 +379,10 @@ async function aBundlesFindingWriter(): Promise<void> {
}
}
test("a call a stopping tool runner did not take is asked again after a pause until the new runner answers; a plain refusal is not (design 47 H2 H-A-542, H-A-544)", async () => {
test("a call a stopping tool runner did not take is asked again after a pause until the new runner answers or the bound ends; a plain refusal and a bare timeout are not (design 47 H2 H-A-542, H-A-544, H-A-549)", async () => {
const child = spawn(process.execPath, [fileURLToPath(new URL("./fixtures/stdio-stopping.mjs", import.meta.url))],
{ stdio: ["pipe", "pipe", "pipe"], env: { ...process.env, MESH_SERVED_MODULE: "builder",
MESH_CONFIG_KEPT_CALL_PACE_FIRST: "1ms", MESH_CONFIG_KEPT_CALL_PACE_MAX: "2ms" } });
MESH_CONFIG_KEPT_CALL_PACE_FIRST: "2s", MESH_CONFIG_KEPT_CALL_PACE_MAX: "4s", MESH_CONFIG_ASK_BOUND: "10s" } });
const seen: any[] = [];
let buffered = "";
let said = "";
@@ -405,8 +405,13 @@ test("a call a stopping tool runner did not take is asked again after a pause un
send({ jsonrpc: "2.0", id: 1, method: "initialize", params: { protocolVersion: "2025-03-26", capabilities: {} } });
await until((m) => m.id === 1);
for (const row of [
{ id: 2, answers: [{ error: stopping }, { error: stopping }, { result: { published: true } }], want: { answer: { published: true } } },
{ id: 3, answers: [{ error: { code: -32000, message: "refused" } }], want: { stopping: false, words: "refused" } },
// The pace and the bound are the settings (2 s doubling to 4 s, a bound of 10 s, H-A-549); the pause moves a clock.
{ id: 2, answers: [{ error: stopping }, { error: stopping }, { result: { published: true } }],
want: { answer: { published: true }, paused: [2000, 4000] } },
{ id: 3, answers: [{ error: stopping }, { error: stopping }, { error: stopping }],
want: { stopping: true, words: `seat:go-package-registry.publish: the tool runner was stopping, asked again until the bound of 10000ms: ${stopping.message}`, paused: [2000, 4000] } },
{ id: 4, answers: [{ error: { code: -32000, message: "refused" } }], want: { stopping: false, words: "refused", paused: [] } },
{ id: 5, answers: [{ error: { code: -32000, message: "timeout" } }], want: { stopping: false, words: "timeout", paused: [] } },
]) {
send({ jsonrpc: "2.0", id: row.id, method: "tools/call", params: { name: "publish", arguments: {} } });
for (const a of row.answers) {