DockerCLI/internal/test
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
..
builders Fix flaky TestContainerList tests 2022-03-28 20:37:06 +02:00
environment update/remove various tests and options related to kubernetes support 2022-02-24 17:53:18 +01:00
network Switch from x/net/context to context 2018-05-11 16:49:43 -07:00
notary Refactor content_trust cli/flags handling 2018-03-08 15:00:43 -05:00
output Fix 'wether'->'whether' 2018-09-07 16:26:18 +08:00
cli.go Remove ClientInfo as it is not practically used. 2022-03-04 15:46:50 +01:00
doc.go Add TESTING document. 2017-08-24 14:45:50 -04:00
store.go Remove docker api dependency from cli/config 2019-01-31 21:25:43 +00:00
strings.go bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-23 00:28:55 +01:00