about summary refs log tree commit homepage
path: root/t/t1000-thread-pool-basic.sh
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-10-05 18:13:12 -0700
committerEric Wong <normalperson@yhbt.net>2009-10-05 18:16:04 -0700
commit112fe9265b4f5b3504504a1a36cafad9c6ceffeb (patch)
tree4eee5d524c9bc1d98f829f43221f9731acc55ac2 /t/t1000-thread-pool-basic.sh
parentd7f1ced710864fd743c605cb85aa35208bf518b3 (diff)
downloadrainbows-112fe9265b4f5b3504504a1a36cafad9c6ceffeb.tar.gz
mktemp(1) requires files to end with "XXXXXXXX", not just have
that template anywhere.  Also, add pid files to the TEST_RM_LIST
since test failures can leave a pid file dangling.  Lastly,
since the config.ru files are 100% static, just check them
as standalone files in instead of allocating a tempfile on them
for easier maintenance.
Diffstat (limited to 't/t1000-thread-pool-basic.sh')
-rwxr-xr-xt/t1000-thread-pool-basic.sh22
1 files changed, 6 insertions, 16 deletions
diff --git a/t/t1000-thread-pool-basic.sh b/t/t1000-thread-pool-basic.sh
index 109f5ae..905d077 100755
--- a/t/t1000-thread-pool-basic.sh
+++ b/t/t1000-thread-pool-basic.sh
@@ -2,23 +2,13 @@
 . ./test-lib.sh
 
 eval $(unused_listen)
-config_ru=$(mktemp -t rainbows.$$.XXXXXXXX.config.ru)
-unicorn_config=$(mktemp -t rainbows.$$.XXXXXXXX.unicorn.rb)
-curl_out=$(mktemp -t rainbows.$$.XXXXXXXX.curl.out)
-curl_err=$(mktemp -t rainbows.$$.XXXXXXXX.curl.err)
-pid=$(mktemp -t rainbows.$$.XXXXXXXX.pid)
-TEST_RM_LIST="$TEST_RM_LIST $config_ru $unicorn_config $lock_path"
+unicorn_config=$(mktemp -t rainbows.$$.unicorn.rb.XXXXXXXX)
+curl_out=$(mktemp -t rainbows.$$.curl.out.XXXXXXXX)
+curl_err=$(mktemp -t rainbows.$$.curl.err.XXXXXXXX)
+pid=$(mktemp -t rainbows.$$.pid.XXXXXXXX)
+TEST_RM_LIST="$TEST_RM_LIST $unicorn_config $lock_path $pid"
 TEST_RM_LIST="$TEST_RM_LIST $curl_out $curl_err"
 
-cat > $config_ru <<\EOF
-use Rack::ContentLength
-use Rack::ContentType
-run lambda { |env|
-  sleep 1
-  [ 200, {}, [ Thread.current.inspect << "\n" ] ]
-}
-EOF
-
 nr_client=30
 nr_thread=10
 
@@ -31,7 +21,7 @@ Rainbows! do
 end
 EOF
 
-rainbows -D $config_ru -c $unicorn_config
+rainbows -D t1000.ru -c $unicorn_config
 wait_for_pid $pid
 
 start=$(date +%s)