-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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_in_tail: Fix unstable tests #3767
Conversation
CI fails on all windows versions. |
416160d
to
f6994e9
Compare
`sub_test_rotate_file` should pass a rotated file to block, not a new file. In addition, it should be opened by `Fluent::FileWrapper` to avoid locking. Signed-off-by: Takuro Ashie <[email protected]>
…qual` Signed-off-by: Takuro Ashie <[email protected]>
4e78a31
to
d5b74b1
Compare
Signed-off-by: Takuro Ashie <[email protected]>
b8f0261
to
65af256
Compare
Hmm, it seems that unstable tests are caused by failure of removing previous test files:
|
9dfc0d3
to
944b16d
Compare
7224d90
to
d8336e5
Compare
On windows, sometimes fails to remove old test files, it makes tests unstable. Signed-off-by: Takuro Ashie <[email protected]>
Since we always create a new test ditectory on each tests, ensuring to remove old directory in hacky way is no longer needed. In addition, we already dropped Ruby 2.6 support, and the previous implementation has some bugs. For example `FileUtils.rm_f` doesn't have `secure` option even though the latest Ruby (v3.1), probably it intend `FileUtils.rm_r`. Signed-off-by: Takuro Ashie <[email protected]>
* TestWithSystem should call super at setup and teadown * EX_* should be placed just under TailInputTest Signed-off-by: Takuro Ashie <[email protected]>
Signed-off-by: Takuro Ashie <[email protected]>
d8336e5
to
4f3b7f3
Compare
All tests succeeded by just one try after a long absence 🎉 |
Signed-off-by: Takuro Ashie <[email protected]>
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.
Looks good for fixing unstable tests on Windows.
Still failing macOS CI tasks but these are not related this fix.
Thanks! |
Which issue(s) this PR fixes:
None
What this PR does / why we need it:
sub_test_rotate_file
should pass a rotated file to the block, not a new file.In addition, it should be opened by
Fluent::FileWrapper
to avoid locking.In addition, the previous implementations has some bugs, for example
FileUtils.rm_f
doesn't havesecure
option even though the latest Ruby (v3.1), probably it intendFileUtils.rm_r
.Docs Changes:
None
Release Note:
Same with the title.