Skip to content

Commit

Permalink
e2e: new cluster version needs more time to upgrade.
Browse files Browse the repository at this point in the history
  • Loading branch information
YoyinZyc committed Oct 17, 2019
1 parent add72f9 commit 5544c02
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tests/e2e/etcd_release_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package e2e
import (
"fmt"
"os"
"strings"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -105,12 +104,17 @@ func TestReleaseUpgrade(t *testing.T) {

// TODO: update after release candidate
// expect upgraded cluster version
ver := version.Version
if strings.HasSuffix(ver, "-pre") {
ver = strings.Replace(ver, "-pre", "", 1)
ver := version.Cluster(version.Version)
for i := 0; i < 7; i++ {
if err = cURLGet(epc, cURLReq{endpoint: "/version", expected: `"etcdcluster":"` + ver}); err != nil {
t.Logf("#%d: %v is not ready yet (%v)", i, ver, err)
time.Sleep(time.Second)
continue
}
break
}
if err := cURLGet(cx.epc, cURLReq{endpoint: "/metrics", expected: fmt.Sprintf(`etcd_cluster_version{cluster_version="%s"} 1`, ver), metricsURLScheme: cx.cfg.metricsURLScheme}); err != nil {
cx.t.Fatalf("failed get with curl (%v)", err)
if err != nil {
t.Fatalf("cluster version is not upgraded (%v)", err)
}
}

Expand Down

0 comments on commit 5544c02

Please sign in to comment.