From 755270fa6aba4b92c2e7c687b42f8097580f5e0e Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Thu, 13 Jul 2017 14:55:43 -0700 Subject: [PATCH] integration: sync lapi server after puts in TestLeaseTimeToLive Linearized read to ensure the keys have committed. --- clientv3/integration/lease_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/clientv3/integration/lease_test.go b/clientv3/integration/lease_test.go index ef176fddf..65f8adcb3 100644 --- a/clientv3/integration/lease_test.go +++ b/clientv3/integration/lease_test.go @@ -482,7 +482,8 @@ func TestLeaseTimeToLive(t *testing.T) { clus := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 3}) defer clus.Terminate(t) - lapi := clus.RandClient() + c := clus.RandClient() + lapi := c resp, err := lapi.Grant(context.Background(), 10) if err != nil { @@ -497,6 +498,11 @@ func TestLeaseTimeToLive(t *testing.T) { } } + // linearized read to ensure Puts propagated to server backing lapi + if _, err := c.Get(context.TODO(), "abc"); err != nil { + t.Fatal(err) + } + lresp, lerr := lapi.TimeToLive(context.Background(), resp.ID, clientv3.WithAttachedKeys()) if lerr != nil { t.Fatal(lerr)