From 1fd70d6bd23c94d06a12525516054d708c7084ff Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 20 Feb 2019 12:52:40 -0500 Subject: [PATCH] revise timestamp correction scheme For very slow CI this test still fails so establish the date as being between the range of what the operation took Change-Id: I9204cd1915777ebc58bd598065b9015befb93345 (cherry picked from commit a3135c494e510095c938d0e7a08c4ffc0b4bb364) --- test/dialect/mysql/test_types.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/dialect/mysql/test_types.py b/test/dialect/mysql/test_types.py index ed5bbcb2be..daaf678320 100644 --- a/test/dialect/mysql/test_types.py +++ b/test/dialect/mysql/test_types.py @@ -686,22 +686,23 @@ class TypesTest( # server-system-variables.html#sysvar_explicit_defaults_for_timestamp # changes this for 5.6 if set. - # normalize dates that are over the second boundary + # normalize dates for the amount of time the operation took def normalize(dt): if dt is None: return None - elif (dt - now).seconds < 5: + elif now <= dt <= new_now: return now else: return dt with testing.db.begin() as conn: now = conn.scalar("select now()") - conn.execute(ts_table.insert(), {"t1": now, "t2": None}) conn.execute(ts_table.insert(), {"t1": None, "t2": None}) conn.execute(ts_table.insert(), {"t2": None}) + new_now = conn.scalar("select now()") + eq_( [ tuple([normalize(dt) for dt in row]) -- 2.47.2