mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-15 13:17:24 -04:00
f1a22596e2
For Windows, time.time() may only have 16 millisecond accuracy, so invalidation routines which compare the time.time() of invalidate() to the time.time() when the ConnectionRecord last connected may fail in a unit test environment that does not pause at least this much time since the ConnectionRecord startup. Using >= for comparison instead of > was considered but this only leads to more confusing results as the ConnecitonRecord goes into a re-connect loop as time continues to not pass. Overall, while using routines such as Python 3.7's time_ns() might be helpful, for now make sure tests which rely on this are marked under timing intensive and add small sleeps. Change-Id: I1a7162e67912d22c135fa517b687a073f8fd9151