diff options
author | Paweł Gronowski <pawel.gronowski@docker.com> | 2023-03-06 10:53:00 +0100 |
---|---|---|
committer | Sebastiaan van Stijn <github@gone.nl> | 2023-04-21 12:26:59 +0200 |
commit | 4d57ee692d0d839fea9116a1c2338a61588b9050 (patch) | |
tree | f3ada9188ca384bae1c399f7665f38ef1f4ae77a | |
parent | 838d5ea0585889dc17cae68f51a6e5d04d66d0bc (diff) | |
download | docker-4d57ee692d0d839fea9116a1c2338a61588b9050.tar.gz |
TestLogs: Increase stop check poll timeout on Windows
Stopping container on Windows can sometimes take longer than 10s which
caused this test to be flaky.
Increase the timeout to 75s when running this test on Windows.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 74dbb721aa42fa30678662e0450f1302265d0221)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
-rw-r--r-- | integration/container/logs_test.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/integration/container/logs_test.go b/integration/container/logs_test.go index f166c6b46c..5edee730af 100644 --- a/integration/container/logs_test.go +++ b/integration/container/logs_test.go @@ -124,6 +124,12 @@ func testLogs(t *testing.T, logDriver string) { }, } + pollTimeout := time.Second * 10 + if testEnv.OSType == "windows" { + // hcs can take longer than 10s to stop a container. + pollTimeout = time.Second * 75 + } + for _, tC := range testCases { tC := tC t.Run(tC.desc, func(t *testing.T) { @@ -136,7 +142,9 @@ func testLogs(t *testing.T, logDriver string) { ) defer client.ContainerRemove(ctx, id, types.ContainerRemoveOptions{Force: true}) - poll.WaitOn(t, container.IsStopped(ctx, client, id), poll.WithDelay(time.Millisecond*100)) + poll.WaitOn(t, container.IsStopped(ctx, client, id), + poll.WithDelay(time.Millisecond*100), + poll.WithTimeout(pollTimeout)) logs, err := client.ContainerLogs(ctx, id, tC.logOps) assert.NilError(t, err) |