From e1e38f343c08b779c4eb942832cfe799fd7d1112 Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Tue, 8 Nov 2022 10:22:21 -0800 Subject: [PATCH 1/2] chore(datastore): integration test fix --- datastore/integration_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/datastore/integration_test.go b/datastore/integration_test.go index b4d6b8792790..5c868fae9cbf 100644 --- a/datastore/integration_test.go +++ b/datastore/integration_test.go @@ -225,6 +225,9 @@ func TestIntegration_GetWithReadTime(t *testing.T) { t.Fatalf("Transaction.Commit: %v\n", err) } + // We need to wait a few seconds to allow eventual consistency to catch up. + time.Sleep(time.Duration(10 * math.Pow(10, 9))) + testutil.Retry(t, 5, time.Duration(5*math.Pow(10, 9)), func(r *testutil.R) { got := RT{} tm := ReadTime(time.Now()) From 3b678d572e20acb9721395945ffe29fa24b2e225 Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Tue, 8 Nov 2022 10:33:40 -0800 Subject: [PATCH 2/2] per reviewer --- datastore/integration_test.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/datastore/integration_test.go b/datastore/integration_test.go index 5c868fae9cbf..1f9d9612f600 100644 --- a/datastore/integration_test.go +++ b/datastore/integration_test.go @@ -21,7 +21,6 @@ import ( "flag" "fmt" "log" - "math" "os" "reflect" "sort" @@ -225,10 +224,7 @@ func TestIntegration_GetWithReadTime(t *testing.T) { t.Fatalf("Transaction.Commit: %v\n", err) } - // We need to wait a few seconds to allow eventual consistency to catch up. - time.Sleep(time.Duration(10 * math.Pow(10, 9))) - - testutil.Retry(t, 5, time.Duration(5*math.Pow(10, 9)), func(r *testutil.R) { + testutil.Retry(t, 5, time.Duration(10*time.Second), func(r *testutil.R) { got := RT{} tm := ReadTime(time.Now())