3 t_plan
9 "reap worker logging messages"
5 t_begin
"setup and start" && {
7 cat >> $unicorn_config <<EOF
8 after_fork { |s,w| File.open('$fifo','w') { |f| f.write '.' } }
10 unicorn
-c $unicorn_config pid.ru
&
11 test '.' = $
(cat $fifo)
15 t_begin
"kill 1st worker=0" && {
16 pid_1
=$
(curl http
://$listen/)
20 t_begin
"wait for 2nd worker to start" && {
21 test '.' = $
(cat $fifo)
24 t_begin
"ensure log of 1st reap is an ERROR" && {
26 grep 'ERROR.*reaped.*worker=0' $r_err |
grep $pid_1
31 t_begin
"kill 2nd worker gracefully" && {
32 pid_2
=$
(curl http
://$listen/)
36 t_begin
"wait for 3rd worker=0 to start " && {
37 test '.' = $
(cat $fifo)
40 t_begin
"ensure log of 2nd reap is a INFO" && {
41 grep 'INFO.*reaped.*worker=0' $r_err |
grep $pid_2
45 t_begin
"killing succeeds" && {
48 kill -0 $unicorn_pid && false
51 t_begin
"check stderr" && {