summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-07-20 12:02:33 -0500
committerGitHub <[email protected]>2026-07-20 12:02:33 -0500
commit44167710cbfbaadcf0ec223f1452c0d24a3e5e2d (patch)
treee3026758fe19f8f566ce956b0ca0f62a4f353480 /tests
parentc53360b910791c34eec8a72e32bcc6e207ed7423 (diff)
parentc544c1bd6ac7cf9c989abd887067d34b0455bd66 (diff)
downloadhutch-stats-44167710cbfbaadcf0ec223f1452c0d24a3e5e2d.tar.gz
hutch-stats-44167710cbfbaadcf0ec223f1452c0d24a3e5e2d.tar.bz2
hutch-stats-44167710cbfbaadcf0ec223f1452c0d24a3e5e2d.zip
Merge pull request #8 from zerolabsco/fix/idempotency-test-time-bomb
fix: make todo idempotency test timestamps relative to now
Diffstat (limited to 'tests')
-rw-r--r--tests/test_ingestion.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_ingestion.py b/tests/test_ingestion.py
index 81c4084..693d575 100644
--- a/tests/test_ingestion.py
+++ b/tests/test_ingestion.py
@@ -237,13 +237,15 @@ def branch_payload(*branches: str) -> dict:
def test_todo_ingestion_is_idempotent(db_session) -> None:
settings = make_settings()
+ # The poller polls the last 30 days, so keep fixture events inside that window.
+ now = datetime.now(tz=UTC)
payload = {
"me": {"canonicalName": "~ccleberg"},
"events": {
"results": [
{
"id": "1001",
- "created": "2026-05-01T10:00:00Z",
+ "created": (now - timedelta(days=3)).isoformat(),
"ticket": {
"id": "123",
"ref": "~ccleberg/todo/123",
@@ -262,7 +264,7 @@ def test_todo_ingestion_is_idempotent(db_session) -> None:
},
{
"id": "1002",
- "created": "2026-05-02T09:00:00Z",
+ "created": (now - timedelta(days=2, hours=1)).isoformat(),
"ticket": {
"id": "123",
"ref": "~ccleberg/todo/123",
@@ -281,7 +283,7 @@ def test_todo_ingestion_is_idempotent(db_session) -> None:
},
{
"id": "1003",
- "created": "2026-05-02T10:00:00Z",
+ "created": (now - timedelta(days=2)).isoformat(),
"ticket": {
"id": "123",
"ref": "~ccleberg/todo/123",