summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-05-15 13:55:21 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-05-15 13:55:21 -0700
commit7ce45e5d9e455cffe35f724164b82f445f387783 (patch)
treea7630f1f1670ac744b09facc4eedbe566db123e5 /spec
parent5404e6f2711efff087f570d8ac0dc062ff8de821 (diff)
parent765ffc8047b8f7c83d386150c3c8eab3f438e9a1 (diff)
downloadmixlib-shellout-7ce45e5d9e455cffe35f724164b82f445f387783.tar.gz
Merge pull request #94 from chef/lcg/no-getpgrp
remove getpgrp back to setsid
Diffstat (limited to 'spec')
-rw-r--r--spec/mixlib/shellout_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb
index 1765026..75d9821 100644
--- a/spec/mixlib/shellout_spec.rb
+++ b/spec/mixlib/shellout_spec.rb
@@ -1013,15 +1013,15 @@ describe Mixlib::ShellOut do
let(:cmd) { [ 'exit' ] }
it "handles ESRCH from getpgid of a zombie", :unix_only do
- Process.stub(:setpgrp) { exit!(4) }
+ Process.stub(:setsid) { exit!(4) }
- # there is a small race condition here if the child doesn't get
- # scheduled and call exit! before the parent can call getpgid, so run
- # this a few times to make sure we've created the reproduction case
- # correctly.
+ # we used to have race conditions if the child exited and zombied
+ # quickly which would cause an exception. we no longer call getpgrp()
+ # after setsid()/setpgrp() though so this race condition should no
+ # longer exist. still test 5 times for it though.
5.times do
s = Mixlib::ShellOut.new(cmd)
- s.run_command # should not raise Errno::ESRCH
+ s.run_command # should not raise Errno::ESRCH (or anything else)
end
end