Skip to content

Commit

Permalink
Clean up docker driver test to make it less flaky (#10559)
Browse files Browse the repository at this point in the history
Co-authored-by: Mahmood Ali <mahmood@hashicorp.com>
  • Loading branch information
isabeldepapel and Mahmood Ali committed May 10, 2021
1 parent ef0ebcd commit 2766444
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/docker/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3032,7 +3032,7 @@ func TestDockerDriver_StopSignal(t *testing.T) {
require.NoError(t, err)
require.NoError(t, d.WaitUntilStarted(task.ID, 5*time.Second))

stopErr := make(chan error)
stopErr := make(chan error, 1)
go func() {
err := d.StopTask(task.ID, 1*time.Second, c.jobKillSignal)
stopErr <- err
Expand All @@ -3054,8 +3054,7 @@ func TestDockerDriver_StopSignal(t *testing.T) {
}
}
case err := <-stopErr:
t.Errorf("stop task failed: %v", err)
break WAIT
require.NoError(t, err, "stop task failed")
case <-timeout:
// timeout waiting for signals
require.Equal(t, c.expectedSignals, receivedSignals, "timed out waiting for expected signals")
Expand Down

0 comments on commit 2766444

Please sign in to comment.