Skip to content

Commit f9de4cc

Browse files
gaultierory-bot
authored andcommitted
chore: make SCIM work with single-region CRDB
GitOrigin-RevId: 75ad7a5b7e4585b55145404ba1e487522b028886
1 parent 86103bc commit f9de4cc

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

courier/test/persistence.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ func TestPersister(ctx context.Context, newNetworkUnlessExisting NetworkWrapper,
4747

4848
messages := make([]courier.Message, 5)
4949
t.Run("case=add messages to the queue", func(t *testing.T) {
50-
t.Cleanup(func() { pop.SetNowFunc(time.Now) })
50+
t.Cleanup(func() { pop.SetNowFunc(func() time.Time { return time.Now().Round(time.Second) }) })
5151
now := time.Now()
5252
for k := range messages {
5353
// We need to fake the time func to control the created_at column, which is the
5454
// sort key for the messages.
55-
pop.SetNowFunc(func() time.Time { return now.Add(time.Duration(k) * time.Hour) })
55+
pop.SetNowFunc(func() time.Time { return now.Add(time.Duration(k) * time.Hour).Round(time.Second) })
5656
require.NoError(t, faker.FakeData(&messages[k]))
5757
require.NoError(t, p.AddMessage(ctx, &messages[k]))
5858
}

session/test/persistence.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func TestPersister(ctx context.Context, conf *config.Config, p interface {
169169
device,
170170
}
171171
pop.SetNowFunc(func() time.Time {
172-
return start.Add(time.Duration(j) * time.Minute)
172+
return start.Add(time.Duration(j) * time.Minute).Round(time.Second)
173173
})
174174
require.NoError(t, l.UpsertSession(ctx, &seedSessionsList[j]))
175175
seedSessionIDs[j] = seedSessionsList[j].ID

session/tokenizer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func TestTokenizer(t *testing.T) {
8080
tkn := session.NewTokenizer(reg)
8181
nowDate := time.Date(2023, 02, 01, 00, 00, 00, 0, time.UTC)
8282
tkn.SetNowFunc(func() time.Time {
83-
return nowDate
83+
return nowDate.Round(time.Second)
8484
})
8585

8686
r := httptest.NewRequest("GET", "/sessions/whoami", nil)

0 commit comments

Comments
 (0)