Skip to content

Commit

Permalink
Fix test panic in docker driver test
Browse files Browse the repository at this point in the history
  • Loading branch information
isabeldepapel committed May 7, 2021
1 parent 334de88 commit 1b22964
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/docker/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3032,11 +3032,10 @@ func TestDockerDriver_StopSignal(t *testing.T) {
require.NoError(t, err)
require.NoError(t, d.WaitUntilStarted(task.ID, 5*time.Second))

stopErr := make(chan error)
go func() {
err := d.StopTask(task.ID, 1*time.Second, c.jobKillSignal)
if err != nil {
t.Errorf("stop task failed: %v", err)
}
stopErr <- err
}()

timeout := time.After(10 * time.Second)
Expand All @@ -3054,6 +3053,9 @@ func TestDockerDriver_StopSignal(t *testing.T) {
break WAIT
}
}
case err := <-stopErr:
t.Errorf("stop task failed: %v", err)
break WAIT
case <-timeout:
// timeout waiting for signals
require.Equal(t, c.expectedSignals, receivedSignals, "timed out waiting for expected signals")
Expand Down

0 comments on commit 1b22964

Please sign in to comment.