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)
|
||||
end
|
||||
|
||||
def pause
|
||||
sleep 0.2
|
||||
end
|
||||
|
||||
def test_append_spawns
|
||||
saw = []
|
||||
|
||||
|
@ -22,6 +26,8 @@ class TestThreadPool < Test::Unit::TestCase
|
|||
|
||||
pool << 1
|
||||
|
||||
pause
|
||||
|
||||
assert_equal [1], saw
|
||||
assert_equal 1, pool.spawned
|
||||
end
|
||||
|
@ -34,6 +40,8 @@ class TestThreadPool < Test::Unit::TestCase
|
|||
pool << 2
|
||||
pool << 3
|
||||
|
||||
pause
|
||||
|
||||
assert_equal 2, pool.backlog
|
||||
|
||||
finish = true
|
||||
|
@ -44,6 +52,8 @@ class TestThreadPool < Test::Unit::TestCase
|
|||
|
||||
pool << 1
|
||||
|
||||
pause
|
||||
|
||||
assert_equal 1, pool.spawned
|
||||
pool.trim
|
||||
assert_equal 0, pool.spawned
|
||||
|
|
Loading…
Reference in a new issue