test: stabilize exec resolver timeout fixture

This commit is contained in:
Peter Steinberger
2026-03-08 03:50:41 +00:00
parent 5214859c52
commit dc78725d47

View File

@@ -195,14 +195,14 @@ describe("secret ref resolver", () => {
itPosix("uses timeoutMs as the default no-output timeout for exec providers", async () => {
const root = await createCaseDir("exec-delay");
const scriptPath = path.join(root, "resolver-delay.mjs");
const scriptPath = path.join(root, "resolver-delay.sh");
// Keep the fixture cheap to start so this stays deterministic under a busy test run.
await writeSecureFile(
scriptPath,
[
"#!/usr/bin/env node",
"setTimeout(() => {",
" process.stdout.write(JSON.stringify({ protocolVersion: 1, values: { delayed: 'ok' } }));",
"}, 30);",
"#!/bin/sh",
"sleep 0.03",
'printf \'{"protocolVersion":1,"values":{"delayed":"ok"}}\'',
].join("\n"),
0o700,
);