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(artifacts): replace sleeps with flush when waiting on a file to write #4523
Conversation
For some reason on my machine the calls to don't work consistently; this is faster and more reliable as a way to ensure files are written with sequential c/m/a times.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4523 +/- ##
==========================================
+ Coverage 83.08% 83.12% +0.03%
==========================================
Files 259 259
Lines 32979 32979
==========================================
+ Hits 27401 27414 +13
+ Misses 5578 5565 -13
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Nice! Thanks for the fix!
getting away from time based tests is def an improvement :)
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.
lgtm!
Nit: from browsing online, looks like the os.fsync
method guarantees writes to actual disk, I'm seeing a few folks recommend os.flush()
followed by the fysnc.
Ha, I mentioned that in the first PR where I had to add it. I suppose I can be rigorous here instead of stopping once I have it working. |
…tes (#4523) test(artifacts): flush writes instead of sleeping For some reason on my machine the calls to don't work consistently; this is faster and more reliable as a way to ensure files are written with sequential c/m/a times.
Description
Replace flaky calls to
time.sleep(0.1)
with calls toflush
when waiting on a file to write.For some reason on my machine the calls to
time.sleep
often do nothing. Regardless, this is a faster and more reliable way to ensure files are written with sequential c/m/a times.Testing
[test only PR, no behavior change]
Checklist