Skip to content

Commit 5fdbd4e

Browse files
committed
fix: accept both -1 and 143 exit codes in timeout test
On GHA runners, the sleep process may receive SIGTERM from the runner's process management before our 1-second timeout fires. Both exit codes are valid: -1 (our timeout sentinel) and 143 (128 + SIGTERM from external signal). exec sleep prevents orphan processes.
1 parent cf88ed6 commit 5fdbd4e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

crates/sandchest-agent/src/exec.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,12 @@ mod tests {
438438
})
439439
.expect("should have exit event");
440440

441-
// Timed-out process exits with -1 (our sentinel)
442-
assert_eq!(exit_event.exit_code, -1);
441+
// Timed-out process exits with -1 (our sentinel) or 143 (128 + SIGTERM)
442+
assert!(
443+
exit_event.exit_code == -1 || exit_event.exit_code == 143,
444+
"expected exit code -1 or 143, got {}",
445+
exit_event.exit_code
446+
);
443447
}
444448

445449
#[tokio::test]

0 commit comments

Comments
 (0)