diff --git a/drivers/docker/driver_test.go b/drivers/docker/driver_test.go index 103ecfd148f..abfef16bee0 100644 --- a/drivers/docker/driver_test.go +++ b/drivers/docker/driver_test.go @@ -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 @@ -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")