ruby-changes:54412
From: k0kubun <ko1@a...>
Date: Sat, 29 Dec 2018 12:57:18 +0900 (JST)
Subject: [ruby-changes:54412] k0kubun:r66627 (trunk): spawn_spec.rb: add missing platform guard
k0kubun 2018-12-29 12:57:15 +0900 (Sat, 29 Dec 2018) New Revision: 66627 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66627 Log: 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. https://ci.appveyor.com/project/ruby/ruby/builds/21277729 Modified files: trunk/spec/ruby/core/process/spawn_spec.rb Index: spec/ruby/core/process/spawn_spec.rb =================================================================== --- spec/ruby/core/process/spawn_spec.rb (revision 66626) +++ spec/ruby/core/process/spawn_spec.rb (revision 66627) @@ -537,19 +537,21 @@ describe "Process.spawn" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/process/spawn_spec.rb#L537 @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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/