diff options
-rw-r--r-- | t/sleep.ru | 13 | ||||
-rwxr-xr-x | t/t3002-revactor-graceful.sh | 2 | ||||
-rwxr-xr-x | t/t3003-revactor-reopen-logs.sh | 2 |
3 files changed, 11 insertions, 6 deletions
@@ -1,11 +1,16 @@ use Rack::ContentLength use Rack::ContentType -sleep_class = ENV['SLEEP_CLASS'] -sleep_class = sleep_class ? Object.const_get(sleep_class) : Kernel -$stderr.puts "sleep_class=#{sleep_class.inspect}" + run lambda { |env| nr = 1 env["PATH_INFO"] =~ %r{/([\d\.]+)\z} and nr = $1.to_f - sleep_class.sleep(nr) + + (case env['rainbows.model'] + when :Revactor + Actor + else + Kernel + end).sleep(nr) + [ 200, {}, [ "Hello\n" ] ] } diff --git a/t/t3002-revactor-graceful.sh b/t/t3002-revactor-graceful.sh index 2a766be..67c6ba3 100755 --- a/t/t3002-revactor-graceful.sh +++ b/t/t3002-revactor-graceful.sh @@ -17,7 +17,7 @@ Rainbows! do end EOF -SLEEP_CLASS=Actor rainbows -D sleep.ru -c $unicorn_config +rainbows -D sleep.ru -c $unicorn_config wait_for_pid $pid for i in $(awk "BEGIN{for(i=0;i<$nr_client;++i) print i}" </dev/null) diff --git a/t/t3003-revactor-reopen-logs.sh b/t/t3003-revactor-reopen-logs.sh index e39160f..8b11c19 100755 --- a/t/t3003-revactor-reopen-logs.sh +++ b/t/t3003-revactor-reopen-logs.sh @@ -19,7 +19,7 @@ Rainbows! do end EOF -SLEEP_CLASS=Actor rainbows -D sleep.ru -c $unicorn_config +rainbows -D sleep.ru -c $unicorn_config wait_for_pid $pid start=$(date +%s) |