1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

spawn_spec.rb: add missing platform guard

this exists for `context "when passed close_others: false" do`, but this
seems to be missing for `context "when passed close_others: true"`.
And this seems to hang forever on Windows since r66622.
21277729

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2018-12-29 03:57:15 +00:00
parent f9dc0fb649
commit 952b218ffe

View file

@ -537,19 +537,21 @@ describe "Process.spawn" do
@options = { close_others: true }
end
it "closes file descriptors >= 3 in the child process even if fds are set close_on_exec=false" do
touch @name
IO.pipe do |r, w|
r.close_on_exec = false
w.close_on_exec = false
platform_is_not :windows do
it "closes file descriptors >= 3 in the child process even if fds are set close_on_exec=false" do
touch @name
IO.pipe do |r, w|
r.close_on_exec = false
w.close_on_exec = false
begin
pid = Process.spawn(ruby_cmd("while File.exist? '#{@name}'; sleep 0.1; end"), @options)
w.close
r.read(1).should == nil
ensure
rm_r @name
Process.wait(pid) if pid
begin
pid = Process.spawn(ruby_cmd("while File.exist? '#{@name}'; sleep 0.1; end"), @options)
w.close
r.read(1).should == nil
ensure
rm_r @name
Process.wait(pid) if pid
end
end
end
end