From bcfbc2bb1f7f60704ebfa9c2305a76e1a2714946 Mon Sep 17 00:00:00 2001 From: usa Date: Fri, 11 Nov 2016 22:39:15 +0000 Subject: merge revision(s) 56684: [Backport #12909] test_process.rb: fix pgroup test * test/ruby/test_process.rb (TestProcess#test_execopts_pgroup): use dynamically assigned pid for the process group, instead of a magic number 2. [ruby-core:78051] [Bug #12909] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@56729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_process.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 4dadfb49d1..66dc07b84a 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -180,7 +180,11 @@ class TestProcess < Test::Unit::TestCase io.close assert_raise(ArgumentError) { system(*TRUECOMMAND, :pgroup=>-1) } - assert_raise(Errno::EPERM) { Process.wait spawn(*TRUECOMMAND, :pgroup=>2) } + IO.popen([RUBY, '-egets'], 'w') do |f| + assert_raise(Errno::EPERM) { + Process.wait spawn(*TRUECOMMAND, :pgroup=>f.pid) + } + end io1 = IO.popen([RUBY, "-e", "print Process.getpgrp", :pgroup=>true]) io2 = IO.popen([RUBY, "-e", "print Process.getpgrp", :pgroup=>io1.pid]) -- cgit v1.2.3