Merge pull request #3504 from thaJeztah/fix_flaky_tests

Fix flaky TestContainerList tests
This commit is contained in:
Sebastiaan van Stijn 2022-03-28 22:10:39 +02:00 committed by GitHub
commit ace0ec599d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View File

@ -1,3 +1,3 @@
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
container_id busybox:latest "top" Less than a second ago Up 1 second c1
container_id busybox:latest "top" Less than a second ago Up 1 second c2,foo/bar
container_id busybox:latest "top" About a minute ago Up 1 minute c1
container_id busybox:latest "top" About a minute ago Up 1 minute c2,foo/bar

View File

@ -1,6 +1,6 @@
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
container_id busybox:latest "top" Less than a second ago Up 1 second c1
container_id busybox:latest "top" Less than a second ago Up 1 second c2
container_id busybox:latest "top" Less than a second ago Up 1 second 80-82/tcp c3
container_id busybox:latest "top" Less than a second ago Up 1 second 81/udp c4
container_id busybox:latest "top" Less than a second ago Up 1 second 8.8.8.8:82->82/tcp c5
container_id busybox:latest "top" About a minute ago Up 1 minute c1
container_id busybox:latest "top" About a minute ago Up 1 minute c2
container_id busybox:latest "top" About a minute ago Up 1 minute 80-82/tcp c3
container_id busybox:latest "top" About a minute ago Up 1 minute 81/udp c4
container_id busybox:latest "top" About a minute ago Up 1 minute 8.8.8.8:82->82/tcp c5

View File

@ -16,8 +16,8 @@ func Container(name string, builders ...func(container *types.Container)) *types
Names: []string{"/" + name},
Command: "top",
Image: "busybox:latest",
Status: "Up 1 second",
Created: time.Now().Unix(),
Status: "Up 1 minute",
Created: time.Now().Add(-1 * time.Minute).Unix(),
}
for _, builder := range builders {