Enable restart statefulset clusters in e2e tests

This commit is contained in:
Janet Kuo 2016-11-16 11:39:05 -08:00
parent 01897bb3c0
commit 849d22b471

View File

@ -55,9 +55,8 @@ const (
mysqlGaleraManifestPath = "test/e2e/testing-manifests/petset/mysql-galera" mysqlGaleraManifestPath = "test/e2e/testing-manifests/petset/mysql-galera"
redisManifestPath = "test/e2e/testing-manifests/petset/redis" redisManifestPath = "test/e2e/testing-manifests/petset/redis"
cockroachDBManifestPath = "test/e2e/testing-manifests/petset/cockroachdb" cockroachDBManifestPath = "test/e2e/testing-manifests/petset/cockroachdb"
// Should the test restart statefulset clusters? // We don't restart MySQL cluster regardless of restartCluster, since MySQL doesn't handle restart well
// TODO: enable when we've productionzed bringup of pets in this e2e. restartCluster = true
restartCluster = false
// Timeout for reads from databases running on pets. // Timeout for reads from databases running on pets.
readTimeout = 60 * time.Second readTimeout = 60 * time.Second
@ -371,11 +370,16 @@ func (c *clusterAppTester) run() {
By("Creating foo:bar in member with index 0") By("Creating foo:bar in member with index 0")
c.pet.write(0, map[string]string{"foo": "bar"}) c.pet.write(0, map[string]string{"foo": "bar"})
switch c.pet.(type) {
case *mysqlGaleraTester:
// Don't restart MySQL cluster since it doesn't handle restarts well
default:
if restartCluster { if restartCluster {
By("Restarting stateful set " + ps.Name) By("Restarting stateful set " + ps.Name)
c.tester.restart(ps) c.tester.restart(ps)
c.tester.waitForRunning(ps.Spec.Replicas, ps) c.tester.waitForRunning(ps.Spec.Replicas, ps)
} }
}
By("Reading value under foo from member with index 2") By("Reading value under foo from member with index 2")
if err := pollReadWithTimeout(c.pet, 2, "foo", "bar"); err != nil { if err := pollReadWithTimeout(c.pet, 2, "foo", "bar"); err != nil {