Skip to content

[19.03 backport] test-fixes for flaky test: TestCheckCapacityAndRotate#41314

Merged
tiborvass merged 2 commits intomoby:19.03from
thaJeztah:19.03_backport_fix_racey_logger_test
Sep 16, 2020
Merged

[19.03 backport] test-fixes for flaky test: TestCheckCapacityAndRotate#41314
tiborvass merged 2 commits intomoby:19.03from
thaJeztah:19.03_backport_fix_racey_logger_test

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah commented Aug 5, 2020

fixes #41138 flaky test: TestCheckCapacityAndRotate

backports of:

Minor conflict in the imports because 19.03 is not yet on gotest.tools/v3

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 5ea5c02)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The test was looking for the wrong file name.
Since compression happens asyncronously, sometimes the test would
succeed and sometimes fail.

This change makes sure to wait for the compressed version of the file
since we can't know when the compression is going to occur.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit c6d860a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah changed the title [19.03 backport] test-fixes for laky test: TestCheckCapacityAndRotate [19.03 backport] test-fixes for flaky test: TestCheckCapacityAndRotate Sep 14, 2020
assert.NilError(t, err, dStringer)
_, err = os.Stat(f.Name() + ".2.gz")
assert.NilError(t, err, dStringer)
poll.WaitOn(t, checkFileExists(f.Name()+".1.gz"), poll.WithDelay(time.Millisecond), poll.WithTimeout(30*time.Second))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thaJeztah you changed .1 to .1.gz

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is because compression is async and there is no way for us to know when it will happen.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpuguy83 I guess I'm not sure I understand what the .1 was trying to test in the version before this PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it testing the same thing if it's checking for .1.gz instead?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just that rotation happens correctly.

@tiborvass tiborvass merged commit bd33bbf into moby:19.03 Sep 16, 2020
@thaJeztah thaJeztah deleted the 19.03_backport_fix_racey_logger_test branch September 16, 2020 14:30
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.

4 participants