]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
make sure thread.join() is used completely here
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 30 Nov 2013 21:54:44 +0000 (16:54 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 30 Nov 2013 21:54:44 +0000 (16:54 -0500)
test/engine/test_pool.py

index a59a040d6561616a3511862e0405cd5ec414a0c5..c395dd8258e797693aaed7e0f62a3696ca918de1 100644 (file)
@@ -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):