-
Notifications
You must be signed in to change notification settings - Fork 3
Get process output from Malt, instead of capturing it ourselves #84
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
base: main
Are you sure you want to change the base?
Conversation
This enables us to get the output generated by crashes jobs.
81c7d58 to
6227e30
Compare
|
So, the remaining failures now are only due to buffering: the tests at ParallelTestRunner.jl/test/runtests.jl Lines 236 to 238 in 608f947
ParallelTestRunner.jl/test/runtests.jl Lines 248 to 251 in 608f947
print-like function, without a newline which would flush the stream.
Unless someone knows a magic way to run julia unbuffered like |
|
@vchuravy @maleadt with the caveat that we need to wait for the upstream PR JuliaPluto/Malt.jl#103, I'd appreciate some feedback about the design of this PR and its tradeoffs. |
83db39f to
ca5c3ae
Compare
ca5c3ae to
02219b7
Compare
src/ParallelTestRunner.jl
Outdated
|
|
||
| # Adapted from `Malt._stdio_loop` | ||
| function stdio_loop(worker::Malt.Worker) | ||
| @async while isopen(worker.stdout_pipe) && Malt.isrunning(worker) |
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.
Something, something about isreadable/isopen
Julia base uses the pattern
buf = Base.BufferStream()
t = @async try
while !eof(stdout_read)
l = readavailable(stdout_read)
write(buf, l)
end
finally
closewrite(buf)
end
Base.errormonitor(t)
return buf
See the tee function in stdlib/REPL/test/repl.jlor an even more advanced fake_repl
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.
That seems to work, I replaced isopen -> !eof, thanks!
Note: still needs tests (can adapt the example above).Tests addedRequires JuliaPluto/Malt.jl#103. Fix #83.