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 74dbb721aa
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
838d5ea058
commit
4d57ee692d
1 changed files with 9 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue