Skip to content

Commit

Permalink
engine: increase process kill timeout (#3444)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Miller committed Jun 11, 2020
1 parent 524d7a0 commit c5f015c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions integration/local_resource_test.go
Expand Up @@ -33,8 +33,8 @@ func TestLocalResourceCleanup(t *testing.T) {

select {
case <-f.activeTiltUp.done:
case <-time.After(2 * time.Second):
t.Fatal("Tilt failed to exit within 2 seconds of SIGTERM")
case <-time.After(5 * time.Second):
t.Fatal("Tilt failed to exit within 5 seconds of SIGTERM")
}

// hello.sh writes to cleanup.txt on SIGTERM
Expand Down
5 changes: 4 additions & 1 deletion internal/engine/local/execer.go
Expand Up @@ -175,7 +175,10 @@ func processRun(ctx context.Context, cmd model.Cmd, w io.Writer, statusCh chan s
} else {
// wait and then send SIGKILL to the process group, unless the command finished
select {
case <-time.After(50 * time.Millisecond):
// we wait 30 seconds to give the process enough time to finish doing any cleanup.
// this is the same timeout that Kubernetes uses
// TODO(dmiller): make this configurable via the Tiltfile
case <-time.After(30 * time.Second):
procutil.KillProcessGroup(c)
case <-doneCh:
}
Expand Down
2 changes: 1 addition & 1 deletion internal/engine/local/execer_test.go
Expand Up @@ -157,7 +157,7 @@ func (f *processExecFixture) waitForStatusAndNoError(expectedStatus status) {
f.t.Error("Unexpected Error sm")
return
}
case <-time.After(10 * time.Second):
case <-time.After(35 * time.Second):
f.t.Fatal("Timed out waiting for cmd sm")
}
}
Expand Down

0 comments on commit c5f015c

Please sign in to comment.