]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Loosen SingletonThreadPoolTest
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 6 Mar 2019 13:18:26 +0000 (08:18 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 6 Mar 2019 14:09:38 +0000 (09:09 -0500)
This test is non-critical as the SingletonThreadPool is
not production-level robust under multithreaded scenarios in
any case.

Fixes: #4527
Change-Id: Ie19ebd69438c97b2d8adb571f8f1b2c56894f7fb

test/engine/test_pool.py

index 1aadd477d98878a1434956139e0084d50552f4cc..3722ce9b9fdd46b1c3bf2a9e4ae6891bf46f4081 100644 (file)
@@ -15,6 +15,7 @@ from sqlalchemy.testing import eq_
 from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import is_
 from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_true
 from sqlalchemy.testing.engines import testing_engine
 from sqlalchemy.testing.mock import ANY
 from sqlalchemy.testing.mock import call
@@ -1809,7 +1810,9 @@ class SingletonThreadPoolTest(PoolTestBase):
             threads.append(th)
         for th in threads:
             th.join(join_timeout)
-        eq_(len(p._all_conns), 3)
+
+        lp = len(p._all_conns)
+        is_true(3 <= lp <= 4)
 
         if strong_refs:
             still_opened = len([c for c in sr if not c.close.call_count])