1
0
Fork 0
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:
Evan Phoenix 2011-09-23 20:49:45 -07:00
parent f5ecd5dca6
commit 70c444d2c5

View file

@ -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