Merge pull request #6635 from gabriel-samfira/fix-deadline-exceeded-in-daemon-restart

[Windows] Fix deadline exceeded in daemon restart
This commit is contained in:
Phil Estes 2022-03-10 12:30:38 -05:00 committed by GitHub
commit 8047eb2fca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2036,7 +2036,12 @@ func TestDaemonRestart(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer task.Delete(ctx)
defer func() {
if _, err := task.Delete(ctx, WithProcessKill); err != nil {
t.Logf("failed to delete task: %v", err)
}
}()
statusC, err := task.Wait(ctx)
if err != nil {
@ -2058,7 +2063,10 @@ func TestDaemonRestart(t *testing.T) {
t.Errorf(`first task.Wait() should have failed with "transport is closing"`)
}
waitCtx, waitCancel := context.WithTimeout(ctx, 2*time.Second)
// NOTE(gabriel-samfira): Windows needs a bit more time to restart.
// Increase timeout from 2 seconds to 10 seconds to avoid deadline
// exceeded errors.
waitCtx, waitCancel := context.WithTimeout(ctx, 10*time.Second)
serving, err := client.IsServing(waitCtx)
waitCancel()
if !serving {