| From: Miri Amarilio <mirilio@google.com> |
| Date: Wed, 14 Feb 2024 15:45:00 +0000 |
| Subject: [PATCH] Add sleep time in TestContainerStopCancellation to let the container completely start up before continuing. |
| |
| In some cases this test would fail due to the container not being fully up by the time the next command in the test is executed. |
| This patch is meant to prevent that from happening. |
| |
| diff --git a/integration/container_stop_test.go b/integration/container_stop_test.go |
| index 616a940..ef4eb0f 100644 |
| --- a/integration/container_stop_test.go |
| +++ b/integration/container_stop_test.go |
| @@ -97,6 +97,8 @@ func TestContainerStopCancellation(t *testing.T) { |
| |
| t.Log("Start the container") |
| require.NoError(t, runtimeService.StartContainer(cn)) |
| + // Allow the container to fully start before continuing |
| + time.Sleep(5 * time.Second) |
| |
| t.Log("Stop the container with 3s timeout, but 1s context timeout") |
| // Note that with container pid namespace, the sleep process |