From 0c3417dcf98604ba1e3cb9415c893b9029ec04e5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Sep 2025 00:52:24 +0000 Subject: [PATCH 01/12] Initial plan From 7db36be9aeb5eb5c6ed26226cd8d8306bce1c73e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Sep 2025 00:57:34 +0000 Subject: [PATCH 02/12] Update dependencies and Go version to latest stable versions Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com> --- .github/workflows/build.yml | 6 +++--- go.mod | 8 ++++---- go.sum | 13 ++++++------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0c8b086..aa1f2bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,16 +12,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Go 1.x - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: - go-version: ^1.17 + go-version: ^1.21 id: go - name: Set up linter run: go get -u github.com/mgechev/revive - name: Check out code into the Go module directory - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Get dependencies run: go get -v -t -d ./... diff --git a/go.mod b/go.mod index ffd46dd..4eebb27 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,16 @@ module github.com/go-waitfor/waitfor-proc -go 1.17 +go 1.21 require ( github.com/go-waitfor/waitfor v1.0.0 github.com/mitchellh/go-ps v1.0.0 - github.com/stretchr/testify v1.7.0 + github.com/stretchr/testify v1.11.1 ) require ( github.com/cenkalti/backoff v2.2.1+incompatible // indirect - github.com/davecgh/go-spew v1.1.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index f0b125d..c453609 100644 --- a/go.sum +++ b/go.sum @@ -1,17 +1,16 @@ github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-waitfor/waitfor v1.0.0 h1:KX6SpTtEM2OOwJu5QP6MXvdi0Llq55d8dywSSZD+gSI= github.com/go-waitfor/waitfor v1.0.0/go.mod h1:a5e6B1hss5InR3moU7xAOP2thPsbjbTArD5+Kud4YaQ= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 28db7e36c68d64a3231e3289e012b6bd79c77e70 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Sep 2025 01:17:35 +0000 Subject: [PATCH 03/12] Modernize build pipeline with matrix testing, caching, and security scanning Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com> --- .github/workflows/build.yml | 93 +++++++++++++++++++++++++++++++------ 1 file changed, 78 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aa1f2bd..3d13166 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,30 +7,93 @@ on: branches: [ main ] jobs: - build: - name: Build - runs-on: ubuntu-latest + test: + name: Test + strategy: + matrix: + go-version: [1.20.x, 1.21.x, 1.22.x] + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} steps: - - name: Set up Go 1.x + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Go ${{ matrix.go-version }} uses: actions/setup-go@v5 with: - go-version: ^1.21 - id: go + go-version: ${{ matrix.go-version }} + cache: true + + - name: Download dependencies + run: go mod download + + - name: Verify dependencies + run: go mod verify + + - name: Build + run: go build -v ./... + + - name: Run tests + run: go test -race -v -coverprofile=coverage.out ./... - - name: Set up linter - run: go get -u github.com/mgechev/revive + - name: Upload coverage to Codecov + if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x' + uses: codecov/codecov-action@v3 + with: + file: ./coverage.out - - name: Check out code into the Go module directory + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Check out code uses: actions/checkout@v4 - - name: Get dependencies - run: go get -v -t -d ./... + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.21.x + cache: true + + - name: Download dependencies + run: go mod download + + - name: Install revive + run: go install github.com/mgechev/revive@latest - - name: Lint + - name: Lint with revive run: revive -config revive.toml -formatter stylish -exclude ./vendor/... ./... - - name: Vet + - name: Run go vet run: go vet ./... - - name: Test - run: go test -v ./... + - name: Run staticcheck + uses: dominikh/staticcheck-action@v1.3.0 + with: + version: "2023.1.7" + + security: + name: Security + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.21.x + cache: true + + - name: Download dependencies + run: go mod download + + - name: Run Gosec Security Scanner + uses: securecodewarrior/github-action-gosec@master + with: + args: '-fmt sarif -out gosec.sarif ./...' + + - name: Upload SARIF file + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: gosec.sarif From d2274ab6b4db749ea9d3230abd308f4a0821f78f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Sep 2025 02:09:14 +0000 Subject: [PATCH 04/12] Fix failing CI pipeline with reliable action versions and compatibility fixes Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com> --- .github/workflows/build.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d13166..5cf46f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: name: Test strategy: matrix: - go-version: [1.20.x, 1.21.x, 1.22.x] + go-version: [1.21.x, 1.22.x] os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: @@ -38,9 +38,10 @@ jobs: - name: Upload coverage to Codecov if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x' - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: file: ./coverage.out + fail_ci_if_error: false lint: name: Lint @@ -68,9 +69,9 @@ jobs: run: go vet ./... - name: Run staticcheck - uses: dominikh/staticcheck-action@v1.3.0 + uses: dominikh/staticcheck-action@v1.3.1 with: - version: "2023.1.7" + version: "latest" security: name: Security @@ -89,11 +90,11 @@ jobs: run: go mod download - name: Run Gosec Security Scanner - uses: securecodewarrior/github-action-gosec@master + uses: securecodewarrior/github-action-gosec@v1 with: args: '-fmt sarif -out gosec.sarif ./...' - name: Upload SARIF file - uses: github/codeql-action/upload-sarif@v2 + uses: github/codeql-action/upload-sarif@v3 with: sarif_file: gosec.sarif From 1e569bf93a9764f4ebba6acc7715654d971c4d3b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Sep 2025 02:28:30 +0000 Subject: [PATCH 05/12] Update Go version to 1.23 and modernize CI matrix Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com> --- .github/workflows/build.yml | 8 ++++---- go.mod | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5cf46f7..c2cf5e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: name: Test strategy: matrix: - go-version: [1.21.x, 1.22.x] + go-version: [1.22.x, 1.23.x] os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: @@ -37,7 +37,7 @@ jobs: run: go test -race -v -coverprofile=coverage.out ./... - name: Upload coverage to Codecov - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x' + if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.23.x' uses: codecov/codecov-action@v4 with: file: ./coverage.out @@ -53,7 +53,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21.x + go-version: 1.23.x cache: true - name: Download dependencies @@ -83,7 +83,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21.x + go-version: 1.23.x cache: true - name: Download dependencies diff --git a/go.mod b/go.mod index 4eebb27..6288811 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/go-waitfor/waitfor-proc -go 1.21 +go 1.23 require ( github.com/go-waitfor/waitfor v1.0.0 From 65fb6077c61642af60ae1d90d2f7b43e0a97e48a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Sep 2025 02:39:08 +0000 Subject: [PATCH 06/12] Fix failing CI pipeline by simplifying problematic actions and using direct tool installation Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com> --- .github/workflows/build.yml | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2cf5e7..8641fde 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,6 +42,8 @@ jobs: with: file: ./coverage.out fail_ci_if_error: false + verbose: true + continue-on-error: true lint: name: Lint @@ -68,33 +70,8 @@ jobs: - name: Run go vet run: go vet ./... - - name: Run staticcheck - uses: dominikh/staticcheck-action@v1.3.1 - with: - version: "latest" - - security: - name: Security - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: 1.23.x - cache: true - - - name: Download dependencies - run: go mod download - - - name: Run Gosec Security Scanner - uses: securecodewarrior/github-action-gosec@v1 - with: - args: '-fmt sarif -out gosec.sarif ./...' + - name: Install staticcheck + run: go install honnef.co/go/tools/cmd/staticcheck@latest - - name: Upload SARIF file - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: gosec.sarif + - name: Run staticcheck + run: staticcheck ./... From 4077726e91c40903cd6c572fbf45459157e3d525 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Sep 2025 03:02:33 +0000 Subject: [PATCH 07/12] Fix CI pipeline PATH issue by adding Go bin directory to PATH Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com> --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8641fde..b5db5d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,6 +58,9 @@ jobs: go-version: 1.23.x cache: true + - name: Add Go bin to PATH + run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + - name: Download dependencies run: go mod download From 9f21c0f8b5b6a0fceaa37f635f6f91b45e5dbd6b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Sep 2025 03:20:04 +0000 Subject: [PATCH 08/12] Fix test failure on macOS by replacing unreliable 'man' command with 'sleep' Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com> --- proc_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proc_test.go b/proc_test.go index d7732d1..73c4ddb 100644 --- a/proc_test.go +++ b/proc_test.go @@ -19,7 +19,7 @@ type TestCommand struct { } func NewTestCommand() (*TestCommand, error) { - cmd := exec.Command("man", "cat") + cmd := exec.Command("sleep", "10") if err := cmd.Start(); err != nil { return nil, err @@ -33,7 +33,7 @@ func NewTestCommand() (*TestCommand, error) { } func (c *TestCommand) Name() string { - return "man" + return "sleep" } func (c *TestCommand) Kill() { From 9ad207654fd3bba46fc977faf35fddb8149cdb70 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 1 Sep 2025 03:40:36 +0000 Subject: [PATCH 09/12] Ensure cross-platform test reliability with explicit comments and sleep command usage Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com> --- proc_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proc_test.go b/proc_test.go index 73c4ddb..4c2f7f7 100644 --- a/proc_test.go +++ b/proc_test.go @@ -19,6 +19,7 @@ type TestCommand struct { } func NewTestCommand() (*TestCommand, error) { + // Use cross-platform compatible sleep command instead of platform-specific commands cmd := exec.Command("sleep", "10") if err := cmd.Start(); err != nil { @@ -33,6 +34,7 @@ func NewTestCommand() (*TestCommand, error) { } func (c *TestCommand) Name() string { + // Return the executable name that should be found by the process scanner return "sleep" } From a6455e87711f76ac7130663c4a243f173089a8c9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Sep 2025 14:24:35 +0000 Subject: [PATCH 10/12] Fix Windows CI test failure by using explicit path for coverage profile Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5db5d6..ef954d4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: run: go build -v ./... - name: Run tests - run: go test -race -v -coverprofile=coverage.out ./... + run: go test -race -v -coverprofile=./coverage.out ./... - name: Upload coverage to Codecov if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.23.x' From 43c4607dd7a9354023ea72276bcb709cf180972a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Sep 2025 14:30:22 +0000 Subject: [PATCH 11/12] Fix Windows CI coverage issue by making coverage generation conditional Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com> --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef954d4..f83ec87 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,9 +33,14 @@ jobs: - name: Build run: go build -v ./... - - name: Run tests + - name: Run tests (with coverage) + if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.23.x' run: go test -race -v -coverprofile=./coverage.out ./... + - name: Run tests (without coverage) + if: matrix.os != 'ubuntu-latest' || matrix.go-version != '1.23.x' + run: go test -race -v ./... + - name: Upload coverage to Codecov if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.23.x' uses: codecov/codecov-action@v4 From d15d901ba58bbec3c5377341c29675c2b574ddcb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Sep 2025 14:44:52 +0000 Subject: [PATCH 12/12] Fix cross-platform test failure by implementing platform-specific test commands Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com> --- proc_test.go | 30 ------------------------------ testcmd_unix_test.go | 36 ++++++++++++++++++++++++++++++++++++ testcmd_windows_test.go | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 30 deletions(-) create mode 100644 testcmd_unix_test.go create mode 100644 testcmd_windows_test.go diff --git a/proc_test.go b/proc_test.go index 4c2f7f7..4241c9c 100644 --- a/proc_test.go +++ b/proc_test.go @@ -2,9 +2,7 @@ package proc_test import ( "context" - "errors" "net/url" - "os/exec" "testing" "time" @@ -14,34 +12,6 @@ import ( "github.com/go-waitfor/waitfor-proc" ) -type TestCommand struct { - cmd *exec.Cmd -} - -func NewTestCommand() (*TestCommand, error) { - // Use cross-platform compatible sleep command instead of platform-specific commands - cmd := exec.Command("sleep", "10") - - if err := cmd.Start(); err != nil { - return nil, err - } - - if cmd.Process == nil { - return nil, errors.New("failed to start the test process") - } - - return &TestCommand{cmd}, nil -} - -func (c *TestCommand) Name() string { - // Return the executable name that should be found by the process scanner - return "sleep" -} - -func (c *TestCommand) Kill() { - _ = c.cmd.Process.Kill() -} - func TestProcess_Use(t *testing.T) { cmd, err := NewTestCommand() diff --git a/testcmd_unix_test.go b/testcmd_unix_test.go new file mode 100644 index 0000000..117ac8e --- /dev/null +++ b/testcmd_unix_test.go @@ -0,0 +1,36 @@ +//go:build !windows + +package proc_test + +import ( + "errors" + "os/exec" +) + +type TestCommand struct { + cmd *exec.Cmd +} + +func NewTestCommand() (*TestCommand, error) { + // Use cross-platform compatible sleep command on Unix-like systems + cmd := exec.Command("sleep", "10") + + if err := cmd.Start(); err != nil { + return nil, err + } + + if cmd.Process == nil { + return nil, errors.New("failed to start the test process") + } + + return &TestCommand{cmd}, nil +} + +func (c *TestCommand) Name() string { + // On Unix-like systems, sleep appears as "sleep" in process list + return "sleep" +} + +func (c *TestCommand) Kill() { + _ = c.cmd.Process.Kill() +} \ No newline at end of file diff --git a/testcmd_windows_test.go b/testcmd_windows_test.go new file mode 100644 index 0000000..06c3a55 --- /dev/null +++ b/testcmd_windows_test.go @@ -0,0 +1,37 @@ +//go:build windows + +package proc_test + +import ( + "errors" + "os/exec" +) + +type TestCommand struct { + cmd *exec.Cmd +} + +func NewTestCommand() (*TestCommand, error) { + // Use timeout command on Windows as it's always available and waits for specified time + // timeout /t 10 waits for 10 seconds but doesn't accept input + cmd := exec.Command("timeout", "/t", "10", "/nobreak") + + if err := cmd.Start(); err != nil { + return nil, err + } + + if cmd.Process == nil { + return nil, errors.New("failed to start the test process") + } + + return &TestCommand{cmd}, nil +} + +func (c *TestCommand) Name() string { + // On Windows, timeout appears as "timeout.exe" in process list + return "timeout.exe" +} + +func (c *TestCommand) Kill() { + _ = c.cmd.Process.Kill() +} \ No newline at end of file