diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2015-05-15 07:21:15 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-05-15 07:21:15 -0700 |
commit | 765ffc8047b8f7c83d386150c3c8eab3f438e9a1 (patch) | |
tree | f849c58e279013bde946120c9f41a6bf8875136a /spec/mixlib/shellout_spec.rb | |
parent | 81235ea8f9478679513b83e5ddcc4c6de09f41d5 (diff) | |
download | mixlib-shellout-765ffc8047b8f7c83d386150c3c8eab3f438e9a1.tar.gz |
remove getpgrp back to setsidlcg/no-getpgrp
Diffstat (limited to 'spec/mixlib/shellout_spec.rb')
-rw-r--r-- | spec/mixlib/shellout_spec.rb | 12 |
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 |