test(store): use millisecond deltas in ListDue ordering test to match PG precision
This commit is contained in:
@@ -63,9 +63,9 @@ func TestPlatformEventStore_ShouldListPendingEventsInOrder(t *testing.T) {
|
|||||||
Payload: map[string]any{"step": 1},
|
Payload: map[string]any{"step": 1},
|
||||||
Status: platformevent.StatusPending,
|
Status: platformevent.StatusPending,
|
||||||
NextAttemptAt: now,
|
NextAttemptAt: now,
|
||||||
OccurredAt: now.Add(-5 * time.Nanosecond),
|
OccurredAt: now.Add(-2 * time.Millisecond),
|
||||||
CreatedAt: now.Add(-5 * time.Nanosecond),
|
CreatedAt: now.Add(-2 * time.Millisecond),
|
||||||
UpdatedAt: now.Add(-5 * time.Nanosecond),
|
UpdatedAt: now.Add(-2 * time.Millisecond),
|
||||||
}
|
}
|
||||||
second := &platformevent.Event{
|
second := &platformevent.Event{
|
||||||
ID: uniqueID("evt"),
|
ID: uniqueID("evt"),
|
||||||
@@ -74,9 +74,9 @@ func TestPlatformEventStore_ShouldListPendingEventsInOrder(t *testing.T) {
|
|||||||
Payload: map[string]any{"step": 2},
|
Payload: map[string]any{"step": 2},
|
||||||
Status: platformevent.StatusPending,
|
Status: platformevent.StatusPending,
|
||||||
NextAttemptAt: now,
|
NextAttemptAt: now,
|
||||||
OccurredAt: now.Add(-4 * time.Nanosecond),
|
OccurredAt: now.Add(-1 * time.Millisecond),
|
||||||
CreatedAt: now.Add(-4 * time.Nanosecond),
|
CreatedAt: now.Add(-1 * time.Millisecond),
|
||||||
UpdatedAt: now.Add(-4 * time.Nanosecond),
|
UpdatedAt: now.Add(-1 * time.Millisecond),
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := store.InsertPending(context.Background(), second); err != nil {
|
if err := store.InsertPending(context.Background(), second); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user