Skip to content

Commit

Permalink
Circumvent pipe buffer deadlock (JuliaTesting#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens authored Aug 24, 2023
1 parent ff9761b commit c6fab8a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/ambiguities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,11 @@ function _find_ambiguities(
end
cmd = `$cmd --startup-file=no -e $code`

out = Pipe()
err = Pipe()
outfile, out = mktemp()
errfile, err = mktemp()
succ = success(pipeline(cmd; stdout = out, stderr = err))
close(out.in)
close(err.in)
strout = String(read(out))
strerr = String(read(err))
strout = read(outfile, String)
strerr = read(errfile, String)
num_ambiguities = if succ
0
else
Expand Down

0 comments on commit c6fab8a

Please sign in to comment.