DockerCLI/internal/test/builders
Sebastiaan van Stijn 8e2d63d5df
Fix flaky TestContainerList tests
These tests were creating a stub container, using the current timestamp as
created date. However, if CI was slow to run the test, `Less than a second ago`
would change into `1 second ago`, causing the test to fail:

    --- FAIL: TestContainerListNoTrunc (0.00s)
        list_test.go:198: assertion failed:
            --- expected
            +++ actual
            @@ -1,4 +1,4 @@
            -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   IMAGE            COMMAND   CREATED        STATUS        PORTS     NAMES
            +container_id   busybox:latest   "top"     1 second ago   Up 1 second             c1
            +container_id   busybox:latest   "top"     1 second ago   Up 1 second             c2,foo/bar

This patch changes the "created" time of the container to be a minute ago. This
will result in `About a minute ago`, with a margin of 1 minute.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-28 20:37:06 +02:00
..
config.go Move internal/test package out of cli. 2017-08-22 10:14:25 -04:00
container.go Fix flaky TestContainerList tests 2022-03-28 20:37:06 +02:00
doc.go Move internal/test package out of cli. 2017-08-22 10:14:25 -04:00
network.go adding network list test 2017-08-29 16:30:37 +02:00
node.go Add Engine version to docker node ls 2018-02-17 02:58:05 +01:00
secret.go Plugable secret backend 2017-09-07 11:10:44 +03:00
service.go internal/test/builders: don't set EndpointSpec by default 2019-10-31 16:08:49 +01:00
swarm.go Move internal/test package out of cli. 2017-08-22 10:14:25 -04:00
task.go updated vendoring 2017-09-01 19:41:06 -04:00
volume.go Add unit tests to docker container ls 2018-02-19 11:22:36 +01:00