about summary refs log tree commit homepage
path: root/t/t9100-thread-timeout.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t9100-thread-timeout.sh')
-rwxr-xr-xt/t9100-thread-timeout.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/t/t9100-thread-timeout.sh b/t/t9100-thread-timeout.sh
new file mode 100755
index 0000000..ab46e5a
--- /dev/null
+++ b/t/t9100-thread-timeout.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+. ./test-lib.sh
+case $model in
+ThreadSpawn|ThreadPool|RevThreadSpawn|RevThreadPool) ;;
+*) t_info "$0 is only compatible with Thread*"; exit 0 ;;
+esac
+
+t_plan 5 "ThreadTimeout Rack middleware test for $model"
+
+t_begin "configure and start" && {
+        rtmpfiles curl_err
+        rainbows_setup
+        rainbows -D t9100.ru -c $unicorn_config
+        rainbows_wait_start
+}
+
+t_begin "normal request should not timeout" && {
+        test x"HI" = x"$(curl -sSf http://$listen/ 2>> $curl_err)"
+}
+
+t_begin "sleepy request times out with 408" && {
+        rm -f $ok
+        curl -sSf http://$listen/2 2>> $curl_err || > $ok
+        test -e $ok
+        grep 408 $curl_err
+}
+
+t_begin "kill server" && {
+        kill $rainbows_pid
+}
+
+t_begin "no errors in Rainbows! stderr" && {
+        check_stderr
+}
+
+t_done