diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-04-13 13:09:05 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-04-13 13:50:23 -0700 |
commit | 8762b78d1b44b50092a8cbfc22e31bf611612a73 (patch) | |
tree | c64dfc95272cee55c36f64a1ba33d55eff30381b /test | |
parent | 943f9ff1a04eb1c0e494bd74b269d3e93e809a98 (diff) | |
download | unicorn-8762b78d1b44b50092a8cbfc22e31bf611612a73.tar.gz |
By reraising SignalException in workers. Since we just rely on default signal handlers for the majority of signals now, ensure those signals actually exit the process.
Diffstat (limited to 'test')
-rw-r--r-- | test/exec/test_exec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/exec/test_exec.rb b/test/exec/test_exec.rb index 596ab88..8780da0 100644 --- a/test/exec/test_exec.rb +++ b/test/exec/test_exec.rb @@ -72,6 +72,22 @@ end end end + def test_exit_signals + %w(INT TERM QUIT).each do |sig| + File.open("config.ru", "wb") { |fp| fp.syswrite(HI) } + pid = xfork { redirect_test_io { exec($unicorn_bin, "-l#@addr:#@port") } } + wait_master_ready("test_stderr.#{pid}.log") + status = nil + assert_nothing_raised do + Process.kill(sig, pid) + pid, status = Process.waitpid2(pid) + end + reaped = File.readlines("test_stderr.#{pid}.log").grep(/reaped/) + assert_equal 1, reaped.size + assert status.exited? + end + end + def test_basic File.open("config.ru", "wb") { |fp| fp.syswrite(HI) } pid = fork do |