Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix a couple flaky/broken tests #3008

Merged
merged 2 commits into from
Jul 26, 2022
Merged

Conversation

milas
Copy link
Contributor

@milas milas commented Jul 26, 2022

test: fix flaky container log test

Ensure the container has exited before attempting to grab the logs.

Since we are not streaming them, it's possible to attach + grab logs
before the output is processed, resulting in a test failure. If the
container has exited, it's guaranteed to have logged :)

test: mark invalid test as xfail

This test looks for some behavior on non-chunked HTTP requests.

It now fails because it looks like recent versions of Docker Engine
ALWAYS return chunked responses (or perhaps this specific response
changed somehow to now trigger chunking whereas it did not previously).

The actual logic it's trying to test is also unusual because it's
trying to hackily propagate errors under the assumption that it'd get
a non-chunked response on failure, which is...not reliable. Arguably,
the chunked reader should be refactored somehow but that's a refactor
we can't really commit to (and it's evidently been ok enough as is
up until now).

Ensure the container has exited before attempting to grab the logs.

Since we are not streaming them, it's possible to attach + grab logs
before the output is processed, resulting in a test failure. If the
container has exited, it's guaranteed to have logged :)

Signed-off-by: Milas Bowman <[email protected]>
This test looks for some behavior on non-chunked HTTP requests.

It now fails because it looks like recent versions of Docker Engine
ALWAYS return chunked responses (or perhaps this specific response
changed somehow to now trigger chunking whereas it did not previously).

The actual logic it's trying to test is also unusual because it's
trying to hackily propagate errors under the assumption that it'd get
a non-chunked response on failure, which is...not reliable. Arguably,
the chunked reader should be refactored somehow but that's a refactor
we can't really commit to (and it's evidently been ok enough as is
up until now).

Signed-off-by: Milas Bowman <[email protected]>
@milas milas requested a review from a team July 26, 2022 17:01
@milas milas self-assigned this Jul 26, 2022
@milas milas changed the title Flaky tests test: fix a couple flaky/broken tests Jul 26, 2022
@milas milas merged commit cf62103 into docker:master Jul 26, 2022
@milas milas deleted the flaky-tests branch July 26, 2022 19:48
@milas milas added this to the 6.0.0 milestone Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants