From 99ad1ea83d6366efc1318d1de6ef39ea8ff660ff Mon Sep 17 00:00:00 2001 From: Wim Van Laer Date: Tue, 7 Apr 2026 16:27:45 +0200 Subject: [PATCH] test: added checks for timestamps in passkey test (#12003) # Which Problems Are Solved A test was failing because of timezone flakiness # How the Problems Are Solved The actual problem was an `updatedAt` field was not filled in because of the `createdAt` was missing on an event. This caused a zero value to be filled in into the `updatedAt` field. Postgres then stored this value with seconds in it's timezone info, which go could not store. By adding filling in the `createdAt` field, this does not occur. --- internal/query/projection/user_relational_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/query/projection/user_relational_test.go b/internal/query/projection/user_relational_test.go index ebd33edd9..5845d2b2f 100644 --- a/internal/query/projection/user_relational_test.go +++ b/internal/query/projection/user_relational_test.go @@ -218,6 +218,7 @@ func TestUserRelationalProjection_Reducers(t *testing.T) { 33, "", ) + pkeyVerifiedEvt.Creation = time.Now() // Test eventReduced := callReduce(t, rawTx, handler, pkeyVerifiedEvt) @@ -239,6 +240,8 @@ func TestUserRelationalProjection_Reducers(t *testing.T) { assert.Equal(t, pkeyVerifiedEvt.AAGUID, gotPKey.AuthenticatorAttestationGUID) assert.Equal(t, pkeyVerifiedEvt.SignCount, gotPKey.SignCount) assert.Equal(t, pkeyVerifiedEvt.WebAuthNTokenName, gotPKey.Name) + assert.Equal(t, pkeyVerifiedEvt.Creation.Round(time.Millisecond), gotPKey.UpdatedAt.Round(time.Millisecond)) + assert.Equal(t, pkey.CreatedAt.Round(time.Millisecond), gotPKey.CreatedAt.Round(time.Millisecond)) assert.NotZero(t, gotPKey.VerifiedAt) }) }