mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #8261 from heyitsanthony/fix-test-leasettl
integration: sync lapi server after puts in TestLeaseTimeToLive
This commit is contained in:
commit
7ff1e8f3bb
@ -482,7 +482,8 @@ func TestLeaseTimeToLive(t *testing.T) {
|
|||||||
clus := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 3})
|
clus := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 3})
|
||||||
defer clus.Terminate(t)
|
defer clus.Terminate(t)
|
||||||
|
|
||||||
lapi := clus.RandClient()
|
c := clus.RandClient()
|
||||||
|
lapi := c
|
||||||
|
|
||||||
resp, err := lapi.Grant(context.Background(), 10)
|
resp, err := lapi.Grant(context.Background(), 10)
|
||||||
if err != nil {
|
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())
|
lresp, lerr := lapi.TimeToLive(context.Background(), resp.ID, clientv3.WithAttachedKeys())
|
||||||
if lerr != nil {
|
if lerr != nil {
|
||||||
t.Fatal(lerr)
|
t.Fatal(lerr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user