test(store): use millisecond deltas in ListDue ordering test to match PG precision

This commit is contained in:
Your Name
2026-05-11 14:10:41 +08:00
parent 135718836e
commit 3f8860ab29

View File

@@ -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 {