-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Increase wait time to stabilize TestRotateDateSuffix
#25869
Increase wait time to stabilize TestRotateDateSuffix
#25869
Conversation
This pull request doesn't have a |
@@ -216,15 +216,15 @@ func TestRotateDateSuffix(t *testing.T) { | |||
firstExpectedPattern := fmt.Sprintf("%s-%s.*", logname, time.Now().Format("20060102150405")) | |||
AssertDirContentsPattern(t, dir, firstExpectedPattern) | |||
|
|||
time.Sleep(1500 * time.Millisecond) | |||
time.Sleep(2 * time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand this is a quick fix, but in general this is an antipattern as it elongates the test execution. Do you think it's possible to replace it with mocked time
instance?
For reference: https://github.com/benbjohnson/clock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is indeed not the best solution. It is possible to refactor the code, however, I do not think it worth saving a few seconds when the whole build process for touching libbeat
takes 2-3 hours.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand your concerns, but it's definitely a code smell. I suggest to open a followup Beats issue to fix this test.
💔 Tests Failed
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪Test errorsExpand to view the tests failures
|
Test | Results |
---|---|
Failed | 3 |
Passed | 18225 |
Skipped | 1478 |
Total | 19706 |
Genuine test errors
💔 There are test failures but not known flaky tests, most likely a genuine test failure.
- Name:
Build&Test / metricbeat-goIntegTest / TestFetch – github.com/elastic/beats/v7/metricbeat/module/couchbase/bucket
- Name:
Build&Test / metricbeat-goIntegTest / TestFetch – github.com/elastic/beats/v7/metricbeat/module/couchbase/cluster
- Name:
Build&Test / metricbeat-goIntegTest / TestFetch – github.com/elastic/beats/v7/metricbeat/module/couchbase/node
(cherry picked from commit 9e5aafd)
(cherry picked from commit 9e5aafd)
What does this PR do?
This PR increases the wait time to make sure files get rotated enough times.
Why is it important?
The test has been flaky.
Checklist
- [ ] I have commented my code, particularly in hard-to-understand areas- [ ] I have made corresponding changes to the documentation- [ ] I have made corresponding change to the default configuration files- [ ] I have added tests that prove my fix is effective or that my feature works- [ ] I have added an entry inCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Related issues
Closes #25868