From a5a160461b66cb5bbe2de107af50e62654258c82 Mon Sep 17 00:00:00 2001 From: Baha Aiman Date: Tue, 23 Jan 2024 15:21:20 -0800 Subject: [PATCH] test(firestore): Fix client read time test (#9274) --- firestore/integration_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/firestore/integration_test.go b/firestore/integration_test.go index 6b1a3cb3fb8f..b28ee9212a76 100644 --- a/firestore/integration_test.go +++ b/firestore/integration_test.go @@ -2720,7 +2720,7 @@ func TestIntegration_ClientReadTime(t *testing.T) { } } - tm := time.Now() + tm := time.Now().Add(-time.Minute) c.WithReadOptions(ReadTime(tm)) ds, err := c.GetAll(ctx, docs) @@ -2728,10 +2728,9 @@ func TestIntegration_ClientReadTime(t *testing.T) { t.Fatal(err) } - // TODO(6894): Re-enable this test when snapshot reads is available on test project. - t.SkipNow() + wantReadTime := tm.Truncate(time.Second) for _, d := range ds { - if !tm.Equal(d.ReadTime) { + if !wantReadTime.Equal(d.ReadTime) { t.Errorf("wanted read time: %v; got: %v", tm.UnixNano(), d.ReadTime.UnixNano()) }