httpdate: favor gettimeofday(2) over time(2) for correctness
[unicorn.git] / t / t9001-oob_gc.sh
blobdcd81005cc05076069ca6201a55e775fff4158f4
1 #!/bin/sh
2 . ./test-lib.sh
3 t_plan 9 "OobGC test"
5 t_begin "setup and start" && {
6 unicorn_setup
7 unicorn -D -c $unicorn_config oob_gc.ru
8 unicorn_wait_start
11 t_begin "test default interval (4 requests)" && {
12 test xfalse = x$(curl -vsSf http://$listen/ 2>> $tmp)
13 test xfalse = x$(curl -vsSf http://$listen/ 2>> $tmp)
14 test xfalse = x$(curl -vsSf http://$listen/ 2>> $tmp)
15 test xfalse = x$(curl -vsSf http://$listen/ 2>> $tmp)
18 t_begin "GC starting-request returns immediately" && {
19 test xfalse = x$(curl -vsSf http://$listen/ 2>> $tmp)
22 t_begin "GC is started after 5 requests" && {
23 test xtrue = x$(curl -vsSf http://$listen/ 2>> $tmp)
26 t_begin "reset GC" && {
27 test xfalse = x$(curl -vsSf -X POST http://$listen/gc_reset 2>> $tmp)
30 t_begin "test default interval again (3 requests)" && {
31 test xfalse = x$(curl -vsSf http://$listen/ 2>> $tmp)
32 test xfalse = x$(curl -vsSf http://$listen/ 2>> $tmp)
33 test xfalse = x$(curl -vsSf http://$listen/ 2>> $tmp)
36 t_begin "GC is started after 5 requests" && {
37 test xtrue = x$(curl -vsSf http://$listen/ 2>> $tmp)
40 t_begin "killing succeeds" && {
41 kill -QUIT $unicorn_pid
44 t_begin "check_stderr" && check_stderr
45 dbgcat r_err
47 t_done