Skip to content

Commit 9b411d2

Browse files
committed
fix(snapshots): scope registry teardown signal
The local-registry teardown sent SIGTERM to both the server process and its process group (kill -TERM <pid> -<pid>). On the GitHub-hosted ubuntu-latest PTY runs that process-group signal leaked past the case boundary and reached the Actions runner agent, which reported "runner received a shutdown signal" and cancelled the job. Confirmed via a bpftrace probe on signal:signal_generate: no suite process ever sends a SIGINT, so the runner itself was doing the cancelling in response to the stray group SIGTERM. Scope the SIGTERM to the direct child; the server's own handler still removes its throwaway caches and the force-kill fallback still guarantees teardown.
1 parent dceae8c commit 9b411d2

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

  • crates/vite_cli_snapshots/tests/cli_snapshots

crates/vite_cli_snapshots/tests/cli_snapshots/main.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -658,15 +658,13 @@ struct RegistryHandle {
658658
impl Drop for RegistryHandle {
659659
fn drop(&mut self) {
660660
// Graceful first: SIGTERM the server so its handler removes the
661-
// throwaway yarn/bun caches. Signal both the process itself and its
662-
// group (whether the child ended up a group leader can vary), so the
663-
// handler reliably runs regardless.
661+
// throwaway yarn/bun caches. Keep this scoped to the direct child:
662+
// process-group SIGTERM can leak past the case boundary on
663+
// ubuntu-latest PTY runs and interrupt the Actions runner itself.
664664
#[cfg(unix)]
665665
{
666666
let pid = self.child.id();
667-
let _ = std::process::Command::new("kill")
668-
.args(["-TERM", &pid.to_string(), &format!("-{pid}")])
669-
.output();
667+
let _ = std::process::Command::new("kill").args(["-TERM", &pid.to_string()]).output();
670668
}
671669
#[cfg(windows)]
672670
{

0 commit comments

Comments
 (0)