From 53355a9a38072273ab349463c450f14b0e0d2247 Mon Sep 17 00:00:00 2001 From: Baha Aiman Date: Wed, 23 Aug 2023 11:52:20 -0700 Subject: [PATCH 1/2] fix(datastore): Truncate transaction read time to millisecond --- datastore/integration_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datastore/integration_test.go b/datastore/integration_test.go index 3dfd082c67f0..fe1eeed94f3a 100644 --- a/datastore/integration_test.go +++ b/datastore/integration_test.go @@ -724,7 +724,7 @@ func TestIntegration_AggregationQueries(t *testing.T) { } // Create transaction with read before creating entities - readTime := time.Now() + readTime := time.Now().Truncate(time.Millisecond) txBeforeCreate, err := client.NewTransaction(ctx, []TransactionOption{ReadOnly, WithReadTime(readTime)}...) if err != nil { t.Fatalf("client.NewTransaction: %v", err) @@ -742,7 +742,7 @@ func TestIntegration_AggregationQueries(t *testing.T) { }() // Create transaction with read after creating entities - readTime = time.Now() + readTime = time.Now().Truncate(time.Millisecond) txAfterCreate, err := client.NewTransaction(ctx, []TransactionOption{ReadOnly, WithReadTime(readTime)}...) if err != nil { t.Fatalf("client.NewTransaction: %v", err) From 20093e390783268a7f05a5deedb65310047eb1b9 Mon Sep 17 00:00:00 2001 From: Baha Aiman Date: Wed, 23 Aug 2023 12:04:02 -0700 Subject: [PATCH 2/2] fix(datastore): Truncate transaction read time to microsecond --- datastore/integration_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datastore/integration_test.go b/datastore/integration_test.go index fe1eeed94f3a..e98237837cbe 100644 --- a/datastore/integration_test.go +++ b/datastore/integration_test.go @@ -724,7 +724,7 @@ func TestIntegration_AggregationQueries(t *testing.T) { } // Create transaction with read before creating entities - readTime := time.Now().Truncate(time.Millisecond) + readTime := time.Now().Truncate(time.Microsecond) txBeforeCreate, err := client.NewTransaction(ctx, []TransactionOption{ReadOnly, WithReadTime(readTime)}...) if err != nil { t.Fatalf("client.NewTransaction: %v", err) @@ -742,7 +742,7 @@ func TestIntegration_AggregationQueries(t *testing.T) { }() // Create transaction with read after creating entities - readTime = time.Now().Truncate(time.Millisecond) + readTime = time.Now().Truncate(time.Microsecond) txAfterCreate, err := client.NewTransaction(ctx, []TransactionOption{ReadOnly, WithReadTime(readTime)}...) if err != nil { t.Fatalf("client.NewTransaction: %v", err)