From 4116a143e0d27408ac57085daaa780f8087bb0b6 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Wed, 8 Dec 2021 13:12:07 -0500 Subject: [PATCH] fix misleading errors on vault shutdown --- agent/connect/ca/testing.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/agent/connect/ca/testing.go b/agent/connect/ca/testing.go index a1bbc6a4e2..92673dcb9e 100644 --- a/agent/connect/ca/testing.go +++ b/agent/connect/ca/testing.go @@ -1,6 +1,7 @@ package ca import ( + "errors" "fmt" "io/ioutil" "os" @@ -160,7 +161,7 @@ func runTestVault(t testing.T) (*TestVaultServer, error) { } t.Cleanup(func() { if err := testVault.Stop(); err != nil { - t.Log("failed to stop vault server: %w", err) + t.Logf("failed to stop vault server: %v", err) } }) @@ -207,7 +208,7 @@ func (v *TestVaultServer) Stop() error { } if v.cmd.Process != nil { - if err := v.cmd.Process.Signal(os.Interrupt); err != nil { + if err := v.cmd.Process.Signal(os.Interrupt); err != nil && !errors.Is(err, os.ErrProcessDone) { return fmt.Errorf("failed to kill vault server: %v", err) } }