]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
force a sleep for test_reconnect
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 7 Oct 2020 13:47:46 +0000 (09:47 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 7 Oct 2020 13:49:40 +0000 (09:49 -0400)
as I dont have a windows machine to test I don't really know
how to get a millisecond-accurate timer for windows,
Python documentation claimed time.monotonic() did this however
the continued failure of test_reconnect indicates this is not the case
and that the timer is still bumping up by multi-millisecond
granularity.   force a delay instead.

Change-Id: I237b223eabc55c1d47ecece13873be1f7be20e47

test/engine/test_reconnect.py

index a6cec2ea2fabe79493c7cf4dc6b3b354255d7790..8881620f78480ce0cdf1042bf29bd5fd19d482fe 100644 (file)
@@ -405,6 +405,9 @@ class MockReconnectTest(fixtures.TestBase):
 
         self.dbapi.shutdown()
 
+        # force windows monotonic timer to definitely increment
+        time.sleep(0.5)
+
         # close on DBAPI connection occurs here, as it is detected
         # as invalid.
         assert_raises(tsa.exc.DBAPIError, conn.execute, select(1))