hooks: harden timeout kill and add platform split
- Move runHook into build-tagged implementations (unix/windows) to keep unix syscalls off Windows builds. - In unix implementation, guard nil Process, return wrapped kill errors except ESRCH, and document linkage to TestRunSync_KillsDescendants. - On Windows, best-effort kill on timeout retains prior behavior. - In tests, move testing.Short earlier and keep descendant-kill coverage on Linux.
This commit is contained in:
@@ -260,6 +260,10 @@ func TestRunSync_KillsDescendants(t *testing.T) {
|
||||
t.Skip("TestRunSync_KillsDescendants requires Linux /proc")
|
||||
}
|
||||
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long-running descendant kill test in short mode")
|
||||
}
|
||||
|
||||
tmpDir := t.TempDir()
|
||||
hookPath := filepath.Join(tmpDir, HookOnCreate)
|
||||
pidFile := filepath.Join(tmpDir, "child.pid")
|
||||
@@ -279,10 +283,6 @@ func TestRunSync_KillsDescendants(t *testing.T) {
|
||||
}
|
||||
issue := &types.Issue{ID: "bd-test", Title: "Test"}
|
||||
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long-running descendant kill test in short mode")
|
||||
}
|
||||
|
||||
err := runner.RunSync(EventCreate, issue)
|
||||
if err == nil {
|
||||
t.Fatal("Expected RunSync to return an error on timeout")
|
||||
|
||||
Reference in New Issue
Block a user