Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a15c797

Browse files
authored
Merge branch 'main' into issue#15264
2 parents b3c396b + 450c72f commit a15c797

File tree

5 files changed

+4
-1
lines changed

5 files changed

+4
-1
lines changed

provisionersdk/agent_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"net/http"
1414
"net/http/httptest"
1515
"net/url"
16+
"os"
1617
"os/exec"
1718
"runtime"
1819
"strings"
@@ -119,7 +120,9 @@ func TestAgentScript(t *testing.T) {
119120

120121
// Kill the command, wait for the command to yield.
121122
err := cmd.Cancel()
122-
if err != nil {
123+
if errors.Is(err, os.ErrProcessDone) {
124+
t.Log("script has already finished execution")
125+
} else if err != nil {
123126
t.Fatalf("unable to cancel the command: %v, see logs:\n%s", err, output.String())
124127
}
125128
wg.Wait()

0 commit comments

Comments
 (0)