Skip to content

Commit

Permalink
tests: Increase purging gap to try to increase reliability
Browse files Browse the repository at this point in the history
  • Loading branch information
spbnick committed Sep 18, 2024
1 parent faecdc6 commit 0f82c9f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0f82c9f

Please sign in to comment.