mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
quick fix for thread pool timing
This commit is contained in:
parent
f5ecd5dca6
commit
70c444d2c5
1 changed files with 10 additions and 0 deletions
|
@ -13,6 +13,10 @@ class TestThreadPool < Test::Unit::TestCase
|
||||||
@pool = Puma::ThreadPool.new(min, max, &blk)
|
@pool = Puma::ThreadPool.new(min, max, &blk)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pause
|
||||||
|
sleep 0.2
|
||||||
|
end
|
||||||
|
|
||||||
def test_append_spawns
|
def test_append_spawns
|
||||||
saw = []
|
saw = []
|
||||||
|
|
||||||
|
@ -22,6 +26,8 @@ class TestThreadPool < Test::Unit::TestCase
|
||||||
|
|
||||||
pool << 1
|
pool << 1
|
||||||
|
|
||||||
|
pause
|
||||||
|
|
||||||
assert_equal [1], saw
|
assert_equal [1], saw
|
||||||
assert_equal 1, pool.spawned
|
assert_equal 1, pool.spawned
|
||||||
end
|
end
|
||||||
|
@ -34,6 +40,8 @@ class TestThreadPool < Test::Unit::TestCase
|
||||||
pool << 2
|
pool << 2
|
||||||
pool << 3
|
pool << 3
|
||||||
|
|
||||||
|
pause
|
||||||
|
|
||||||
assert_equal 2, pool.backlog
|
assert_equal 2, pool.backlog
|
||||||
|
|
||||||
finish = true
|
finish = true
|
||||||
|
@ -44,6 +52,8 @@ class TestThreadPool < Test::Unit::TestCase
|
||||||
|
|
||||||
pool << 1
|
pool << 1
|
||||||
|
|
||||||
|
pause
|
||||||
|
|
||||||
assert_equal 1, pool.spawned
|
assert_equal 1, pool.spawned
|
||||||
pool.trim
|
pool.trim
|
||||||
assert_equal 0, pool.spawned
|
assert_equal 0, pool.spawned
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue