From 4817a89bd3f7deda1bef1f2b9dc5ff74c2016677 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Wed, 23 Jan 2019 12:34:16 -0500 Subject: [PATCH] tests: avoid assertion in goroutine --- drivers/rkt/driver_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/rkt/driver_test.go b/drivers/rkt/driver_test.go index 03eb5ccce..795995930 100644 --- a/drivers/rkt/driver_test.go +++ b/drivers/rkt/driver_test.go @@ -410,16 +410,15 @@ func TestRktDriver_StartWaitRecoverWaitStop(t *testing.T) { ch, err = harness.WaitTask(context.Background(), task.ID) require.NoError(err) - go func() { - time.Sleep(300 * time.Millisecond) - require.NoError(d.StopTask(task.ID, 0, "SIGKILL")) - }() + require.NoError(d.StopTask(task.ID, 0, "SIGKILL")) select { case result := <-ch: require.NoError(result.Err) require.NotZero(result.ExitCode) + // when killing a task, signal might not propagate + // when executor proc.Wait() call gets "wait: no child processes" error //require.Equal(9, result.Signal) case <-time.After(time.Duration(testutil.TestMultiplier()*5) * time.Second): require.Fail("WaitTask timeout")