From 849d22b471685efec71cdc0a4b945df85ecbeb36 Mon Sep 17 00:00:00 2001 From: Janet Kuo Date: Wed, 16 Nov 2016 11:39:05 -0800 Subject: [PATCH 1/2] Enable restart statefulset clusters in e2e tests --- test/e2e/petset.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/test/e2e/petset.go b/test/e2e/petset.go index 9edba0e26bb..7b253b7bf4f 100644 --- a/test/e2e/petset.go +++ b/test/e2e/petset.go @@ -55,9 +55,8 @@ const ( mysqlGaleraManifestPath = "test/e2e/testing-manifests/petset/mysql-galera" redisManifestPath = "test/e2e/testing-manifests/petset/redis" cockroachDBManifestPath = "test/e2e/testing-manifests/petset/cockroachdb" - // Should the test restart statefulset clusters? - // TODO: enable when we've productionzed bringup of pets in this e2e. - restartCluster = false + // We don't restart MySQL cluster regardless of restartCluster, since MySQL doesn't handle restart well + restartCluster = true // Timeout for reads from databases running on pets. readTimeout = 60 * time.Second @@ -371,10 +370,15 @@ func (c *clusterAppTester) run() { By("Creating foo:bar in member with index 0") c.pet.write(0, map[string]string{"foo": "bar"}) - if restartCluster { - By("Restarting stateful set " + ps.Name) - c.tester.restart(ps) - c.tester.waitForRunning(ps.Spec.Replicas, ps) + switch c.pet.(type) { + case *mysqlGaleraTester: + // Don't restart MySQL cluster since it doesn't handle restarts well + default: + if restartCluster { + By("Restarting stateful set " + ps.Name) + c.tester.restart(ps) + c.tester.waitForRunning(ps.Spec.Replicas, ps) + } } By("Reading value under foo from member with index 2") From f2bab13043322583dbcf2bc0e97fe85b69678613 Mon Sep 17 00:00:00 2001 From: Janet Kuo Date: Thu, 17 Nov 2016 19:24:55 -0800 Subject: [PATCH 2/2] Remove 0 terminationGracePeriodSeconds from statefulset manifests --- test/e2e/testing-manifests/petset/mysql-galera/petset.yaml | 1 - test/e2e/testing-manifests/petset/redis/petset.yaml | 1 - test/e2e/testing-manifests/petset/zookeeper/petset.yaml | 1 - 3 files changed, 3 deletions(-) diff --git a/test/e2e/testing-manifests/petset/mysql-galera/petset.yaml b/test/e2e/testing-manifests/petset/mysql-galera/petset.yaml index 91673bcd5e8..c499837889d 100644 --- a/test/e2e/testing-manifests/petset/mysql-galera/petset.yaml +++ b/test/e2e/testing-manifests/petset/mysql-galera/petset.yaml @@ -57,7 +57,6 @@ spec: } ]' spec: - terminationGracePeriodSeconds: 0 containers: - name: mysql image: gcr.io/google_containers/mysql-galera:e2e diff --git a/test/e2e/testing-manifests/petset/redis/petset.yaml b/test/e2e/testing-manifests/petset/redis/petset.yaml index f67d54e3141..73a4f925022 100644 --- a/test/e2e/testing-manifests/petset/redis/petset.yaml +++ b/test/e2e/testing-manifests/petset/redis/petset.yaml @@ -57,7 +57,6 @@ spec: } ]' spec: - terminationGracePeriodSeconds: 0 containers: - name: redis image: debian:jessie diff --git a/test/e2e/testing-manifests/petset/zookeeper/petset.yaml b/test/e2e/testing-manifests/petset/zookeeper/petset.yaml index 9f2afc42013..aefd42e9d88 100644 --- a/test/e2e/testing-manifests/petset/zookeeper/petset.yaml +++ b/test/e2e/testing-manifests/petset/zookeeper/petset.yaml @@ -61,7 +61,6 @@ spec: } ]' spec: - terminationGracePeriodSeconds: 0 containers: - name: zk image: java:openjdk-8-jre