summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorkaustubh-d <kaustubh@clogeny.com>2014-09-10 10:07:43 +0000
committerkaustubh-d <kaustubh@clogeny.com>2014-09-10 10:07:43 +0000
commit2d9ec7727d2b3890ecd83c611ce09127a8b1724e (patch)
tree7cf4e66fdad4db2c7d1995c93fd51704365dd4c1 /spec
parentda8436d910fda2ea83cc57dfb602cb1180bb1a0d (diff)
downloadmixlib-shellout-2d9ec7727d2b3890ecd83c611ce09127a8b1724e.tar.gz
removed emulated Errno::ESRCH
Diffstat (limited to 'spec')
-rw-r--r--spec/mixlib/shellout_spec.rb21
1 files changed, 11 insertions, 10 deletions
diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb
index 30c473d..d935315 100644
--- a/spec/mixlib/shellout_spec.rb
+++ b/spec/mixlib/shellout_spec.rb
@@ -1076,16 +1076,17 @@ describe Mixlib::ShellOut do
kill_return_val = Process.kill(:INT, child_pgid) # should raise ESRCH
# AIX - kill returns code > 0 for error, where as other platforms return -1. Ruby code signal.c treats < 0 as error and raises exception and hence fails on AIX. So we check the return code for assertions since ruby wont raise an error here.
- raise Errno::ESRCH if kill_return_val != 0
-
- # Debug the failure:
- puts "child pgid=#{child_pgid.inspect}"
- Process.wait
- puts "collected process: #{$?.inspect}"
- puts "initial process listing:\n#{initial_process_listing}"
- puts "current process listing:"
- puts `ps -j`
- raise "Failed to kill all expected processes"
+
+ if(kill_return_val == 0)
+ # Debug the failure:
+ puts "child pgid=#{child_pgid.inspect}"
+ Process.wait
+ puts "collected process: #{$?.inspect}"
+ puts "initial process listing:\n#{initial_process_listing}"
+ puts "current process listing:"
+ puts `ps -j`
+ raise "Failed to kill all expected processes"
+ end
rescue Errno::ESRCH
# this is what we want
end