mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
fix: ignore cancellation error in test (#15532)
Fixes: https://github.com/coder/internal/issues/211
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strings"
|
||||
@@ -119,7 +120,9 @@ func TestAgentScript(t *testing.T) {
|
||||
|
||||
// Kill the command, wait for the command to yield.
|
||||
err := cmd.Cancel()
|
||||
if err != nil {
|
||||
if errors.Is(err, os.ErrProcessDone) {
|
||||
t.Log("script has already finished execution")
|
||||
} else if err != nil {
|
||||
t.Fatalf("unable to cancel the command: %v, see logs:\n%s", err, output.String())
|
||||
}
|
||||
wg.Wait()
|
||||
|
||||
Reference in New Issue
Block a user