From 0ff87a8929e852f102e06ee0729258b006ff93f9 Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Mon, 20 Dec 2021 18:33:36 +0200 Subject: [PATCH] Replace tskill with taskkill This offers a more reliable way of killing a process. The /IM flag allows us to specify the "image name" of the process we're killing. This means we can use wildcards, foce kill a process and all the child processes it may have spawned. Signed-off-by: Gabriel Adrian Samfira --- integration/main_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/main_test.go b/integration/main_test.go index c29abad89..28b9fe68b 100644 --- a/integration/main_test.go +++ b/integration/main_test.go @@ -364,7 +364,7 @@ func Randomize(str string) string { func KillProcess(name string) error { var command []string if goruntime.GOOS == "windows" { - command = []string{"tskill", strings.TrimSuffix(name, ".exe")} + command = []string{"taskkill", "/IM", name, "/F"} } else { command = []string{"pkill", "-x", fmt.Sprintf("^%s$", name)} }