From 3f8860ab2981c897dfcafcfc7bf2821ca8942540 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 11 May 2026 14:10:41 +0800 Subject: [PATCH] test(store): use millisecond deltas in ListDue ordering test to match PG precision --- internal/store/postgres/platform_event_store_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/store/postgres/platform_event_store_test.go b/internal/store/postgres/platform_event_store_test.go index edc40a2..6404067 100644 --- a/internal/store/postgres/platform_event_store_test.go +++ b/internal/store/postgres/platform_event_store_test.go @@ -63,9 +63,9 @@ func TestPlatformEventStore_ShouldListPendingEventsInOrder(t *testing.T) { Payload: map[string]any{"step": 1}, Status: platformevent.StatusPending, NextAttemptAt: now, - OccurredAt: now.Add(-5 * time.Nanosecond), - CreatedAt: now.Add(-5 * time.Nanosecond), - UpdatedAt: now.Add(-5 * time.Nanosecond), + OccurredAt: now.Add(-2 * time.Millisecond), + CreatedAt: now.Add(-2 * time.Millisecond), + UpdatedAt: now.Add(-2 * time.Millisecond), } second := &platformevent.Event{ ID: uniqueID("evt"), @@ -74,9 +74,9 @@ func TestPlatformEventStore_ShouldListPendingEventsInOrder(t *testing.T) { Payload: map[string]any{"step": 2}, Status: platformevent.StatusPending, NextAttemptAt: now, - OccurredAt: now.Add(-4 * time.Nanosecond), - CreatedAt: now.Add(-4 * time.Nanosecond), - UpdatedAt: now.Add(-4 * time.Nanosecond), + OccurredAt: now.Add(-1 * time.Millisecond), + CreatedAt: now.Add(-1 * time.Millisecond), + UpdatedAt: now.Add(-1 * time.Millisecond), } if err := store.InsertPending(context.Background(), second); err != nil {