diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-01-24 20:04:20 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-01-24 20:07:09 -0800 |
commit | 667b05819b85165061c445fb2c75ef161a5de5b6 (patch) | |
tree | af69ab3fe1f143c408c6c9013debf1c9afe26c72 /t | |
parent | 9f7f497dc21d904a1af20465318d85811daf0652 (diff) | |
download | rainbows-667b05819b85165061c445fb2c75ef161a5de5b6.tar.gz |
Edge-triggered epoll concurrency model with blocking accept() in a (hopefully) native thread. This is recommended over Epoll for Ruby 1.9 users as it can workaround accept()-scalability issues on multicore machines.
Diffstat (limited to 't')
-rw-r--r-- | t/GNUmakefile | 1 | ||||
-rw-r--r-- | t/simple-http_XAcceptEpoll.ru | 9 | ||||
-rwxr-xr-x | t/t0113-rewindable-input-false.sh | 2 | ||||
-rwxr-xr-x | t/t0114-rewindable-input-true.sh | 2 | ||||
-rw-r--r-- | t/test_isolate.rb | 1 |
5 files changed, 13 insertions, 2 deletions
diff --git a/t/GNUmakefile b/t/GNUmakefile index 7b50944..538065c 100644 --- a/t/GNUmakefile +++ b/t/GNUmakefile @@ -19,6 +19,7 @@ endif RUBY_ENGINE := $(shell $(RUBY) -e 'puts((RUBY_ENGINE rescue "ruby"))') export RUBY_VERSION RUBY_ENGINE +models += XAcceptEpoll models += Epoll models += WriterThreadPool models += WriterThreadSpawn diff --git a/t/simple-http_XAcceptEpoll.ru b/t/simple-http_XAcceptEpoll.ru new file mode 100644 index 0000000..fc0baa6 --- /dev/null +++ b/t/simple-http_XAcceptEpoll.ru @@ -0,0 +1,9 @@ +use Rack::ContentLength +use Rack::ContentType +run lambda { |env| + if env['rack.multithread'] == false && env['rainbows.model'] == :XAcceptEpoll + [ 200, {}, [ Thread.current.inspect << "\n" ] ] + else + raise env.inspect + end +} diff --git a/t/t0113-rewindable-input-false.sh b/t/t0113-rewindable-input-false.sh index 82b0fb7..1119dbf 100755 --- a/t/t0113-rewindable-input-false.sh +++ b/t/t0113-rewindable-input-false.sh @@ -3,7 +3,7 @@ skip_models EventMachine NeverBlock skip_models Rev RevThreadSpawn RevThreadPool skip_models Coolio CoolioThreadSpawn CoolioThreadPool -skip_models Epoll +skip_models Epoll XAcceptEpoll t_plan 4 "rewindable_input toggled to false" diff --git a/t/t0114-rewindable-input-true.sh b/t/t0114-rewindable-input-true.sh index fd8561c..f4ef796 100755 --- a/t/t0114-rewindable-input-true.sh +++ b/t/t0114-rewindable-input-true.sh @@ -3,7 +3,7 @@ skip_models EventMachine NeverBlock skip_models Rev RevThreadSpawn RevThreadPool skip_models Coolio CoolioThreadSpawn CoolioThreadPool -skip_models Epoll +skip_models Epoll XAcceptEpoll t_plan 4 "rewindable_input toggled to true" diff --git a/t/test_isolate.rb b/t/test_isolate.rb index 7b601e7..7ab4dd8 100644 --- a/t/test_isolate.rb +++ b/t/test_isolate.rb @@ -18,6 +18,7 @@ lock.flock(File::LOCK_EX) Isolate.now!(opts) do gem 'unicorn', '3.3.1' gem 'kcar', '0.1.2' + gem 'raindrops', '0.4.1' if engine == "ruby" gem 'sendfile', '1.0.0' # next Rubinius should support this |