Clean up docker driver test to make it less flaky (#10559)

Co-authored-by: Mahmood Ali <mahmood@hashicorp.com>
This commit is contained in:
Isabel Suchanek 2021-05-10 14:58:19 -07:00 committed by GitHub
parent d4465f01ac
commit ed9e12cdc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -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")