-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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/file: try to fix freezing of test_22566 #23001
Conversation
What does this do? A simple blocking read/write of a byte would be preferable to a timed sleep. |
@vtjnash recent CI build froze quite frequently after my PR #22566 merged. |
I will try it tmr. :) |
+++ b/test/file.jl
@@ -1141,11 +1141,12 @@ if !Sys.iswindows()
fn = tempname()
run(`mkfifo $fn`)
- script = "x = open(\"$fn\", \"w\"); sleep(0.1); close(x); quit()"
+ script = "x = open(\"$fn\", \"w\"); write(x, 0x42); flush(x); close(x); quit()"
cmd = `$(Base.julia_cmd()) --startup-file=no -e $script`
open(pipeline(cmd, stderr=STDERR))
r = open(fn, "r")
+ @test read(r, Int64) == 66
close(r)
rm(fn) got this
or I'm okay with getting rid of this test case.. |
You're only writing a byte, but attempting to read an Int64 |
test/file.jl
Outdated
@@ -1141,7 +1141,7 @@ if !Sys.iswindows() | |||
fn = tempname() | |||
run(`mkfifo $fn`) | |||
|
|||
script = "x = open(\"$fn\", \"w\"); close(x)" | |||
script = "x = open(\"$fn\", \"w\"); sleep(0.1); close(x); quit()" |
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.
while we're changing this test, can you replace \"$fn\"
with $(repr(fn))
for me too? (that'll make it robust against other random meta-characters happening to to get inject into temp path)
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.
🆗
- wrap the long single scripts - using `$(repr(fn))` for inserting temp file name - use STDIN to synchronize fifo open calls for each end
or any suggestion to test
open_cloexec
insrc/support/ios.c
?