From 5bbc1577f601653d3f5849b80ee22776a411ed8c Mon Sep 17 00:00:00 2001 From: Nikolai Kondrashov Date: Tue, 17 Sep 2024 16:45:48 +0200 Subject: [PATCH] tests: Increase purging gap to try to increase reliability --- test_main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test_main.py b/test_main.py index f7500c8d..59b3083f 100644 --- a/test_main.py +++ b/test_main.py @@ -248,6 +248,8 @@ def test_purge_db(empty_deployment): # Use the current time to avoid deployment purge trigger timestamp_before = datetime.now(timezone.utc) str_before = timestamp_before.isoformat(timespec="microseconds") + timestamp_cutoff = timestamp_before + timedelta(seconds=1) + str_cutoff = timestamp_cutoff.isoformat(timespec="microseconds") data_before = dict( version=dict( @@ -276,7 +278,7 @@ def test_purge_db(empty_deployment): )], ) - timestamp_after = timestamp_before + timedelta(microseconds=1) + timestamp_after = timestamp_cutoff + timedelta(seconds=1) str_after = timestamp_after.isoformat(timespec="microseconds") data_after = dict( @@ -335,7 +337,7 @@ def filter_test_data(data): # Trigger the purge at the boundary publisher.publish( - dict(database=database, timedelta=dict(stamp=str_after)) + dict(database=database, timedelta=dict(stamp=str_cutoff)) ) # Wait and check for the purge