diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-11-30 16:54:44 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-11-30 16:54:44 -0500 |
commit | 604df86190359c8516594a21c42be0cdf10b6492 (patch) | |
tree | ecbcb0a83fbfb06448ed5f64d1b4a7d58de9ad51 /test/engine/test_pool.py | |
parent | 94f0541ebd008a875a50ff3a935a78bc5682c6e0 (diff) | |
download | sqlalchemy-604df86190359c8516594a21c42be0cdf10b6492.tar.gz |
make sure thread.join() is used completely here
Diffstat (limited to 'test/engine/test_pool.py')
-rw-r--r-- | test/engine/test_pool.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/engine/test_pool.py b/test/engine/test_pool.py index a59a040d6..c395dd825 100644 --- a/test/engine/test_pool.py +++ b/test/engine/test_pool.py @@ -899,12 +899,12 @@ class QueuePoolTest(PoolTestBase): c1 = p.connect() c2 = p.connect() - threads = set() + threads = [] for i in range(2): t = threading.Thread(target=waiter, args=(p, timeout, max_overflow)) t.start() - threads.add(t) + threads.append(t) c1.invalidate() c2.invalidate() @@ -938,14 +938,18 @@ class QueuePoolTest(PoolTestBase): c1 = p1.connect() + threads = [] for i in range(5): t = threading.Thread(target=waiter, args=(p1, )) - t.setDaemon(True) t.start() + threads.append(t) time.sleep(.5) eq_(canary, [1]) p1._pool.abort(p2) - time.sleep(1) + + for t in threads: + t.join(join_timeout) + eq_(canary, [1, 2, 2, 2, 2, 2]) def test_dispose_closes_pooled(self): |