Skip to content

Commit

Permalink
Add wait delay to sigterm
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Nola <[email protected]>
  • Loading branch information
dereknola committed May 5, 2023
1 parent dae5f7b commit cb77990
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"os/user"
"strings"
"syscall"
"time"

"github.com/k3s-io/k3s/pkg/flock"
"github.com/pkg/errors"
Expand Down Expand Up @@ -255,10 +256,11 @@ func K3sStopServer(server *K3sServer) error {
if server.log != nil {
server.log.Close()
}
server.cmd.WaitDelay = 30 * time.Second
if err := server.cmd.Process.Signal(syscall.SIGTERM); err != nil {
return errors.Wrap(err, "failed to kill k3s process")
}
if _, err := server.cmd.Process.Wait(); err != nil {
if err := server.cmd.Wait(); err != nil {
return errors.Wrap(err, "failed to wait for k3s process exit")
}
return nil
Expand Down

0 comments on commit cb77990

Please sign in to comment.