Skip to content

test(agent/agentssh): fix test race and improve Windows compat #17271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 7, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
e tu window?^2
  • Loading branch information
mafredri committed Apr 7, 2025
commit 80bd12cf85f936bbbba0e1642e98f7fd358e7986
6 changes: 3 additions & 3 deletions agent/agentssh/exec_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package agentssh

import (
"context"
"os"
"os/exec"
"syscall"

Expand All @@ -15,7 +14,8 @@ func cmdSysProcAttr() *syscall.SysProcAttr {

func cmdCancel(ctx context.Context, logger slog.Logger, cmd *exec.Cmd) func() error {
return func() error {
logger.Debug(ctx, "cmdCancel: sending interrupt to process", slog.F("pid", cmd.Process.Pid))
return cmd.Process.Signal(os.Interrupt)
logger.Debug(ctx, "cmdCancel: killing process", slog.F("pid", cmd.Process.Pid))
return cmd.Process.Kill()
// return cmd.Process.Signal(os.Interrupt)
}
}
Loading