test(appimage): keep straggler named sleep for multicall coreutils

- Name the copied straggler binary `sleep` so uutils/busybox multicall builds dispatch on argv[0] instead of exiting immediately
- Stop waiting on the straggler exec if it dies early, so the drain assertion reports the failure instead of hanging
This commit is contained in:
sudacode committed 2026-10-28 19:04:52 -07:00
1 parent ad1abc3268
commit 33dceabc3e
1 file changed
+5 -2
+5 -2
View File
@@ -117,7 +117,9 @@ linuxTest('keepalive script releases the mount only after straggler processes ex
// after AppRun itself exits — mimicking Chromium utility children. AppRun waits
// until the straggler has exec'd, otherwise under load the supervisor can scan
// /proc while the forked child is still /bin/sh and release the mount early.
const stragglerPath = path.join(mountDir, 'straggler');
// The copy must keep the name `sleep`: multicall coreutils (uutils on Ubuntu
// 26.04+, busybox) pick the utility from argv[0] and exit immediately otherwise.
const stragglerPath = path.join(mountDir, 'sleep');
fs.copyFileSync('/usr/bin/sleep', stragglerPath);
fs.chmodSync(stragglerPath, 0o755);
writeExecutable(
@@ -126,7 +128,8 @@ linuxTest('keepalive script releases the mount only after straggler processes ex
'#!/bin/sh',
`"${stragglerPath}" 1 &`,
'straggler=$!',
`until [ "$(readlink "/proc/$straggler/exe")" = "${stragglerPath}" ]; do sleep 0.01; done`,
// Bail out if the straggler dies early so the drain assertion reports it.
`while kill -0 "$straggler" 2>/dev/null && [ "$(readlink "/proc/$straggler/exe")" != "${stragglerPath}" ]; do sleep 0.01; done`,
`date +%s%N > "${resultsDir}/apprun-exited"`,
'exit 42',
].join('\n'),