e2e: poll '/version' in release upgrade tests

Fix https://github.com/coreos/etcd/issues/7065.
release-3.1
Gyu-Ho Lee 2016-12-29 10:52:40 -08:00
parent 67c75606db
commit 4e1010c1b9
No known key found for this signature in database
GPG Key ID: 1DDD39C7EB70C24C
1 changed files with 14 additions and 0 deletions

View File

@ -49,6 +49,20 @@ func TestReleaseUpgrade(t *testing.T) {
t.Fatalf("error closing etcd processes (%v)", errC)
}
}()
// 3.0 boots as 2.3 then negotiates up to 3.0
// so there's a window at boot time where it doesn't have V3rpcCapability enabled
// poll /version until etcdcluster is >2.3.x before making v3 requests
for i := 0; i < 7; i++ {
if err = cURLGet(epc, cURLReq{endpoint: "/version", expected: `"etcdcluster":"3.0`}); err != nil {
t.Logf("#%d: v3 is not ready yet (%v)", i, err)
time.Sleep(time.Second)
continue
}
break
}
if err != nil {
t.Fatalf("cannot pull version (%v)", err)
}
os.Setenv("ETCDCTL_API", "3")
defer os.Unsetenv("ETCDCTL_API")