Skip to content

fix flaky TestRunContainerWithRmFlag tests#43681

Merged
tianon merged 1 commit intomoby:masterfrom
thaJeztah:reduce_flakiness
Jun 2, 2022
Merged

fix flaky TestRunContainerWithRmFlag tests#43681
tianon merged 1 commit intomoby:masterfrom
thaJeztah:reduce_flakiness

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Jun 2, 2022

This attempts to fix CI flakiness on the TestRunContainerWithRmFlagCannotStartContainer
and TestRunContainerWithRmFlagExitCodeNotEqualToZero tests.

These tests;

  • get a list of all container ID's
  • run a container with --rm
  • wait for it to exit
  • checks that the list of all container IDs is empty

The last step assumes that no other tests are running on the same daemon; if
another test is running, there may be other containers present (unrelated to
the test).

This patch updates the tests to use a docker inspect to verify the container
no longer exists afterwards.

Signed-off-by: Sebastiaan van Stijn [email protected]

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

This attempts to fix CI flakiness on the TestRunContainerWithRmFlagCannotStartContainer
and TestRunContainerWithRmFlagExitCodeNotEqualToZero tests.

These tests;

- get a list of all container ID's
- run a container with `--rm`
- wait for it to exit
- checks that the list of all container IDs is empty

The last step assumes that no other tests are running on the same daemon; if
another test is running, there may be other containers present (unrelated to
the test).

This patch updates the tests to use a `docker inspect` to verify the container
no longer exists afterwards.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
Copy link
Member Author

And of course it failed on two other flaky tests, but not the one I fixed 🥳

@thaJeztah
Copy link
Member Author

Ah, boo; CRIU repo is down indeed;

executor failed running [/bin/sh -c echo 'deb https://download.opensuse.org/repositories/devel:/tools:/criu/Debian_11/ /' > /etc/apt/sources.list.d/criu.list         && apt-get update         && apt-get install -y --no-install-recommends criu         && install -D /usr/sbin/criu /build/criu]: exit code: 100
script returned exit code 1

@thaJeztah
Copy link
Member Author

@rumpl @tianon @crazy-max ptal

@tianon tianon merged commit 0e04b51 into moby:master Jun 2, 2022
@thaJeztah thaJeztah deleted the reduce_flakiness branch June 2, 2022 20:38
@crazy-max
Copy link
Member

@thaJeztah
Copy link
Member Author

Ah, dang.

I guess it's just slowness on Windows then; thinking of it; the --rm was moved to the daemon at some point (before, it was done by the CLI, and synchronous); since it was moved to the daemon, the --rm is asynchronous, so I guess the removal may not have taken place the moment it does the docker inspect 😞

Some possible options;

  • add a time.Sleep() (yuk!)
  • do the inspect in a loop (yuk?)
  • listen for remove events? (yuk?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test: TestRunContainerWithRmFlagCannotStartContainer (on windows)

3 participants