Skip to content

Commit

Permalink
Merge pull request #11266 from YoyinZyc/upgrade-downgrade-test
Browse files Browse the repository at this point in the history
e2e: only expect cluster's major version is > 3 in release upgrade test
  • Loading branch information
jingyih authored Nov 25, 2019
2 parents ec52217 + cab4cac commit 44fc9e3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
21 changes: 13 additions & 8 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 @@ -55,15 +54,15 @@ func TestReleaseUpgrade(t *testing.T) {
// 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":"` + version.Cluster(version.Version)}); err != nil {
if err = cURLGet(epc, cURLReq{endpoint: "/version", expected: `"etcdcluster":"3.`}); err != nil {
t.Logf("#%d: v3 is not ready yet (%v)", i, err)
time.Sleep(time.Second)
continue
}
break
}
if err != nil {
t.Skipf("cannot pull version (%v)", err)
t.Fatalf("cannot pull version (%v)", err)
}

os.Setenv("ETCDCTL_API", "3")
Expand Down Expand Up @@ -105,12 +104,18 @@ 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)
// new cluster version needs more time to upgrade
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
4 changes: 2 additions & 2 deletions tests/semaphore.test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ fi
<<COMMENT
# amd64-e2e
tests/semaphore.test.bash
sudo HOST_TMP_DIR=/tmp TEST_OPTS="PASSES='build release e2e' MANUAL_VER=v3.4.0" make docker-test
sudo HOST_TMP_DIR=/tmp TEST_OPTS="PASSES='build release e2e' MANUAL_VER=v3.4.3" make docker-test
# 386-e2e
sudo HOST_TMP_DIR=/tmp TEST_OPTS="GOARCH=386 PASSES='build e2e'" make docker-test
COMMENT

sudo HOST_TMP_DIR=/tmp TEST_OPTS="PASSES='build release e2e' MANUAL_VER=v3.4.0" make docker-test
sudo HOST_TMP_DIR=/tmp TEST_OPTS="PASSES='build release e2e' MANUAL_VER=v3.4.3" make docker-test

0 comments on commit 44fc9e3

Please sign in to comment.