mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-05 14:35:17 +01:00
test(runner): use a standalone sleep where /bin/sleep is a multicall binary
On the ubuntu-26.04 runner image, /bin/sleep is a multicall binary (the same bytes as /bin/echo). A copy staged as paperclip-runnerd exits 1 even with argv0 set to "sleep", so the two staging tests fail there. Use /usr/bin/gnusleep when /bin/sleep is the multicall binary. Same fixture as #21726, which is green on that image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4e44f10bd0
commit
6faf2749f0
1 file changed
+10
-3
@@ -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, argv0) => {
|
||||
@@ -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"], "sleep");
|
||||
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/sh", 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();
|
||||
|
||||
Reference in new issue
Block a user