diff --git a/integration/local_resource_test.go b/integration/local_resource_test.go index 09cd855d08..34d455bdd6 100644 --- a/integration/local_resource_test.go +++ b/integration/local_resource_test.go @@ -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 diff --git a/internal/engine/local/execer.go b/internal/engine/local/execer.go index c23e3cf0ce..cb5f7c6b99 100644 --- a/internal/engine/local/execer.go +++ b/internal/engine/local/execer.go @@ -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: } diff --git a/internal/engine/local/execer_test.go b/internal/engine/local/execer_test.go index 68c5840181..451a9ae1fd 100644 --- a/internal/engine/local/execer_test.go +++ b/internal/engine/local/execer_test.go @@ -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") } }