Skip to content

Commit

Permalink
spawn test: attempt to enable test for #22832 (#27507)
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 authored and jrevels committed Jul 2, 2018
1 parent ba601d4 commit b4318f7
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 @@ -501,20 +501,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 b4318f7

Please sign in to comment.