Skip to content

Commit fcf0756

Browse files
davidfstrclaude
andcommitted
test(system-runtime): Deflake the same-sandbox procargs read
Increase timeout from 2s to 30s. Cold python3 startup measures as over 10s on a local macOS 15 VM, so the previous timeout was never reliable. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 04f0954 commit fcf0756

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/policy/runtime/system-runtime.bats

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,14 @@ load ../procargs_utils.bash
224224
@test "[EXECUTION] default sandbox can read a same-sandbox process's argv via procargs/procargs2" {
225225
sft_require_cmd_or_skip python3
226226

227+
# The target sleeps far longer than the read needs, then gets killed once the
228+
# read is done. A target that exits first fails the sysctl with EPERM, which is
229+
# indistinguishable from a policy denial (see procargs_utils.bash), and cold
230+
# python3 startup inside the sandbox has been measured at over 10s on CI.
227231
local reader selector
228232
reader="$(sft_procargs_reader_py)"
229233
for selector in $KERN_PROCARGS $KERN_PROCARGS2; do
230-
safehouse_run -- /bin/sh -c '/bin/sleep 2 & c=$!; /bin/sleep 1; exec python3 -c "$1" "$2" "$c"' _ "$reader" "$selector"
234+
safehouse_run -- /bin/sh -c '/bin/sleep 60 & c=$!; /bin/sleep 1; python3 -c "$1" "$2" "$c"; s=$?; /bin/kill "$c"; exit $s' _ "$reader" "$selector"
231235
[ "$status" -eq 0 ]
232236
sft_assert_contains "$output" "sleep"
233237
done

0 commit comments

Comments
 (0)