Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit 58c34fd

Browse files
committed
e2e: add experimental flag and move etcd test to it.
1 parent 79823dc commit 58c34fd

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

e2e/etcdscale_test.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,21 @@ func TestEtcdScale(t *testing.T) {
2626
}
2727
t.Run("ResizeSelfHostedEtcdTo3", func(t *testing.T) { resizeSelfHostedEtcd(t, 3) })
2828
t.Run("CheckEtcdPodDistribution", func(t *testing.T) { checkEtcdPodDistribution(t, 3) })
29-
t.Run("ResizeSelfHostedEtcdTo1", func(t *testing.T) { resizeSelfHostedEtcd(t, 1) })
29+
if *enableExperimental {
30+
// Experimental: currently does not work reliably.
31+
// See: https://github.com/kubernetes-incubator/bootkube/issues/656.
32+
t.Run("ResizeSelfHostedEtcdTo1", func(t *testing.T) { resizeSelfHostedEtcd(t, 1) })
33+
} else {
34+
t.Log("ResizeSelfHostedEtcdTo1: skipped because enable-experimental is false.")
35+
}
3036
}
3137

32-
// Skip if not running 3 or more master nodes unless explicitly told to be
33-
// expecting 3 or more. Then block until 3 are ready or fail. Also check that
34-
// etcd is self-hosted.
38+
// etcdScalePreCheck determines if the etcd scale tests should run. It returns an error if the tests
39+
// should be skipped.
40+
//
41+
// Criteria for running:
42+
// - etcd-operator is running.
43+
// - enough master nodes are available to accommodate new etcd pods.
3544
func etcdScalePreCheck(requiredMasters int) error {
3645
// Check for etcd-operator by getting pod
3746
l, err := client.CoreV1().Pods("kube-system").List(metav1.ListOptions{LabelSelector: "k8s-app=etcd-operator"})

e2e/main_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ import (
1818

1919
// global clients for use by all tests
2020
var (
21-
client kubernetes.Interface
22-
sshClient *SSHClient
23-
expectedMasters int // hint for tests to figure out how to fail or block on resources missing
24-
namespace string
21+
client kubernetes.Interface
22+
sshClient *SSHClient
23+
expectedMasters int // hint for tests to figure out how to fail or block on resources missing
24+
namespace string
25+
enableExperimental = flag.Bool("enable-experimental", false, "If true, runs experimental/flaky tests.")
2526
)
2627

2728
func init() {

0 commit comments

Comments
 (0)