From 95d801ee87c68962f090eaaa1e6c3af98dd5fa9d Mon Sep 17 00:00:00 2001 From: nguyenm7 <13559011+nguyenm7@users.noreply.github.com> Date: Sun, 15 Nov 2026 14:44:22 -0800 Subject: [PATCH] test: make two test fixtures work on the ubuntu-26.04 runner image Same fixture change as #21726, so this PR's CI can pass on the ubuntu-26.04 runner image before that PR merges. The stage-runner test uses a standalone sleep binary where /bin/sleep is a multicall binary, and the runner bridge test exits 1 when the shell redirection fails. Co-Authored-By: Claude Opus 5.5 --- .../scripts/stage-runner-binary.test.mjs | 13 ++++++++++--- .../native-runtime/runner-bridge-tools.test.ts | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/paperclip-runner/scripts/stage-runner-binary.test.mjs b/packages/paperclip-runner/scripts/stage-runner-binary.test.mjs index e262d64a213..b23e2222f1a 100644 --- a/packages/paperclip-runner/scripts/stage-runner-binary.test.mjs +++ b/packages/paperclip-runner/scripts/stage-runner-binary.test.mjs @@ -84,6 +84,12 @@ test("release metadata rejects incompatible native, harness and protocol contrac } }); +async function standaloneSleep() { + if (process.platform !== "linux") return "/bin/sleep"; + const multicall = (await readFile("/bin/sleep")).equals(await readFile("/bin/echo")); + return multicall ? "/usr/bin/gnusleep" : "/bin/sleep"; +} + async function withOwnedChildren(root, action) { const owned = []; const start = (command, args) => { @@ -112,12 +118,13 @@ async function withOwnedChildren(root, action) { test("atomically publishes while the previous executable is running", { skip: process.platform === "win32", timeout: 15_000 }, async () => { const root = await mkdtemp(path.join(tmpdir(), "runnerd-stage-test-")); const destination = path.join(root, "paperclip-runnerd"); + const sleep = await standaloneSleep(); await withOwnedChildren(root, async start => { - await stageRunnerBinary("/bin/sleep", destination); + await stageRunnerBinary(sleep, destination); const previous = await stat(destination); const old = start(destination, ["30"]); await old.spawned; - await stageRunnerBinary("/bin/sleep", destination); + await stageRunnerBinary(sleep, destination); const published = await stat(destination); assert.notEqual(published.ino, previous.ino); assert.equal(published.mode & 0o777, 0o755); @@ -152,7 +159,7 @@ test("a source rebuild selects fresh dev bytes while preserving release binaries await mkdir(path.dirname(built), { recursive: true }); await copyHostFixture("/bin/echo", built); const previousBuild = path.join(root, "previous-build"); - await copyHostFixture("/bin/sleep", previousBuild); + await copyHostFixture(await standaloneSleep(), previousBuild); await stageRunnerBinary(previousBuild, hostTarget); await stageRunnerBinary(built, path.join(binaryRoot, "paperclip-runnerd")); const platforms = {}, releaseBytes = new Map(); diff --git a/server/src/services/native-runtime/runner-bridge-tools.test.ts b/server/src/services/native-runtime/runner-bridge-tools.test.ts index b46cf65e215..beaf4d64cc1 100644 --- a/server/src/services/native-runtime/runner-bridge-tools.test.ts +++ b/server/src/services/native-runtime/runner-bridge-tools.test.ts @@ -176,7 +176,7 @@ if sys.argv[1] != "completion": expect(await readFile(join(directory, "output.txt"), "utf8")).toBe("hello"); const read = await executeWorkspaceTool(directory, "workspace_run", { program: "/bin/cat", args: [secret] }, authorize); expect(read).toMatchObject({ exitCode: 1 }); expect(String((read as any).output)).not.toContain("PRIVATE"); - const write = await executeWorkspaceTool(directory, "workspace_run", { program: "/bin/sh", args: ["-c", 'printf stolen > "$1"', "sh", secret] }, authorize); + const write = await executeWorkspaceTool(directory, "workspace_run", { program: "/bin/sh", args: ["-c", 'printf stolen > "$1" || exit 1', "sh", secret] }, authorize); expect(write).toMatchObject({ exitCode: 1 }); expect(await readFile(secret, "utf8")).toBe("PRIVATE"); }); it.skipIf(!workspaceCommandSandboxAvailable())("stops its owned process on authority loss and bounds output", async () => {