From ae224fadd90f6641a8584536531bc18c2c7e2ab9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 21 Feb 2009 05:00:26 -0800 Subject: test_exec: fix for temporary files not being cleaned Apparently the at_exit handlers were not triggering for an execed process. --- test/exec/test_exec.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/exec/test_exec.rb b/test/exec/test_exec.rb index 4e460e2..7a4e59b 100644 --- a/test/exec/test_exec.rb +++ b/test/exec/test_exec.rb @@ -8,8 +8,13 @@ require 'fileutils' do_test = true $unicorn_bin = ENV['UNICORN_TEST_BIN'] || "unicorn" -pid = fork { redirect_test_io { exec($unicorn_bin, '-v'); exit!(1) } } -Process.waitpid(pid) +redirect_test_io do + pid = fork do + exec($unicorn_bin, '-v') + exit(1) + end + Process.waitpid(pid) +end unless $?.success? STDERR.puts "#{$unicorn_bin} not found in PATH=#{ENV['PATH']}, "\ "skipping this test" -- cgit v1.2.3-24-ge0c7