-
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
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
|
This is now ready for review! |
src/ParallelTestRunner.jl
Outdated
|
|
||
| # Adapted from `Malt._stdio_loop` | ||
| function stdio_loop(worker::PTRWorker) | ||
| @async while !eof(worker.w.stdout) && 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.
Obligatory: Why @async and not @spawn
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.
No specific reason, I had followed the original Malt._stdio_loop. I pushed a change to replace @async -> Threads.@spawn
src/ParallelTestRunner.jl
Outdated
| wrkr = Malt.Worker(; exename, exeflags, env) | ||
| WORKER_IDS[wrkr.proc_pid] = length(WORKER_IDS) + 1 | ||
| io = IOBuffer() | ||
| wrkr = PTRWorker(Malt.Worker(; exename, exeflags, env, monitor_stdout=false, monitor_stderr=false), io) |
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.
Can we fold this into the constructor?
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.
Done! Also included the worker id as a field of the worker (with a global atomic counter), no need to keep a dictionary around for doing the mapping.
src/ParallelTestRunner.jl
Outdated
| break | ||
| end | ||
| end | ||
| @async while !eof(worker.w.stderr) && 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.
Slight order weirdness... What happens if Malt.isrunning is true before we have consumed all the text?
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.
Uhm, to this one I don't have a good answer
|
It's so nice to be able to see the output of a segfault 🥳 |
Note: still needs tests (can adapt the example above).Tests addedRequires JuliaPluto/Malt.jl#103. Fix #83.