Skip to content

Commit

Permalink
spawn test: attempt to enable test for JuliaLang#22832
Browse files Browse the repository at this point in the history
let's hope it passes and doesn't just hang...
  • Loading branch information
vtjnash committed Jun 8, 2018
1 parent 27e03a7 commit 085d1ed
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions test/spawn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -500,20 +500,20 @@ let c = `ls -l "foo bar"`
end

## Deadlock in spawning a cmd (#22832)
# FIXME?
#let out = Pipe(), inpt = Pipe()
# Base.link_pipe!(out, reader_supports_async=true)
# Base.link_pipe!(inpt, writer_supports_async=true)
# p = run(pipeline(catcmd, stdin=inpt, stdout=out, stderr=devnull), wait=false)
# @async begin # feed cat with 2 MB of data (zeros)
# write(inpt, zeros(UInt8, 1048576 * 2))
# close(inpt)
# end
# sleep(0.5) # give cat a chance to fill the write buffer for stdout
# close(out.in) # make sure we can still close the write end
# @test sizeof(readstring(out)) == 1048576 * 2 # make sure we get all the data
# @test success(p)
#end
let out = Pipe(), inpt = Pipe()
Base.link_pipe!(out, reader_supports_async=true)
Base.link_pipe!(inpt, writer_supports_async=true)
p = run(pipeline(catcmd, stdin=inpt, stdout=out, stderr=devnull), wait=false)
@async begin # feed cat with 2 MB of data (zeros)
write(inpt, zeros(UInt8, 1048576 * 2))
close(inpt)
end
sleep(1) # give cat a chance to fill the write buffer for stdout
close(inpt.out)
close(out.in) # make sure we can still close the write end
@test sizeof(read(out)) == 1048576 * 2 # make sure we get all the data
@test success(p)
end

# `kill` error conditions
let p = run(`$sleepcmd 100`, wait=false)
Expand Down

0 comments on commit 085d1ed

Please sign in to comment.