diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-01-05 22:39:03 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-01-05 22:58:18 -0800 |
commit | b72a86f66c722d56a6d77ed1d2779ace6ad103ed (patch) | |
tree | c074232094580831bd110f1dcce528fd69cdcd63 /t/t0018-write-on-close.sh | |
parent | 1b69686fd28347eb5c071a9b76e2939bca424f04 (diff) | |
download | unicorn-b72a86f66c722d56a6d77ed1d2779ace6ad103ed.tar.gz |
Response bodies may capture the block passed to each and save it for body.close, so don't close the socket before we have a chance to call body.close
Diffstat (limited to 't/t0018-write-on-close.sh')
-rwxr-xr-x | t/t0018-write-on-close.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t0018-write-on-close.sh b/t/t0018-write-on-close.sh new file mode 100755 index 0000000..3afefea --- /dev/null +++ b/t/t0018-write-on-close.sh @@ -0,0 +1,23 @@ +#!/bin/sh +. ./test-lib.sh +t_plan 4 "write-on-close tests for funky response-bodies" + +t_begin "setup and start" && { + unicorn_setup + unicorn -D -c $unicorn_config write-on-close.ru + unicorn_wait_start +} + +t_begin "write-on-close response body succeeds" && { + test xGoodbye = x"$(curl -sSf http://$listen/)" +} + +t_begin "killing succeeds" && { + kill $unicorn_pid +} + +t_begin "check stderr" && { + check_stderr +} + +t_done |