[19.03 backport] test-fixes for flaky test: TestCheckCapacityAndRotate#41314
Merged
tiborvass merged 2 commits intomoby:19.03from Sep 16, 2020
Merged
Conversation
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>
AkihiroSuda
approved these changes
Aug 6, 2020
tiborvass
reviewed
Sep 15, 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)) |
Member
There was a problem hiding this comment.
Yes this is because compression is async and there is no way for us to know when it will happen.
Contributor
There was a problem hiding this comment.
@cpuguy83 I guess I'm not sure I understand what the .1 was trying to test in the version before this PR.
Contributor
There was a problem hiding this comment.
Is it testing the same thing if it's checking for .1.gz instead?
Member
There was a problem hiding this comment.
Just that rotation happens correctly.
tiborvass
approved these changes
Sep 16, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #41138 flaky test: TestCheckCapacityAndRotate
backports of:
Minor conflict in the
importsbecause 19.03 is not yet ongotest.tools/v3