Skip to content

Commit e829d1e

Browse files
committed
fix: Prevent microsecond drift when offsets are equal in e2e test
1 parent cec28b1 commit e829d1e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/aignostics/platform/e2e_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,9 @@ def _submit_and_validate( # noqa: PLR0913, PLR0917
273273
ValueError: If more than one tag is provided.
274274
"""
275275
tags = tags or set()
276-
deadline = datetime.now(tz=UTC) + timedelta(seconds=deadline_seconds)
276+
now = datetime.now(tz=UTC)
277+
due_date = now + timedelta(seconds=due_date_seconds)
278+
deadline = now + timedelta(seconds=deadline_seconds)
277279
find_and_validate_at = deadline + timedelta(hours=1)
278280
tags.add(
279281
f"find_and_validate:{find_and_validate_at.month}_{find_and_validate_at.day}_{find_and_validate_at.hour}"
@@ -282,7 +284,7 @@ def _submit_and_validate( # noqa: PLR0913, PLR0917
282284
logger.trace(f"Submitting application run for {application_id} version {application_version}")
283285
client = platform.Client()
284286
scheduling = {
285-
"due_date": (datetime.now(tz=UTC) + timedelta(seconds=due_date_seconds)).isoformat(),
287+
"due_date": due_date.isoformat(),
286288
"deadline": deadline.isoformat(),
287289
}
288290
custom_metadata = {

0 commit comments

Comments
 (0)