Merge pull request #7075 from gyuho/version-pull

e2e: poll '/version' in release upgrade tests
This commit is contained in:
Gyu-Ho Lee 2016-12-29 11:29:45 -08:00 committed by GitHub
commit 734dd75565

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")