Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable restart statefulset clusters in e2e tests #36910

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 11 additions & 7 deletions test/e2e/petset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
1 change: 0 additions & 1 deletion test/e2e/testing-manifests/petset/mysql-galera/petset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ spec:
}
]'
spec:
terminationGracePeriodSeconds: 0
containers:
- name: mysql
image: gcr.io/google_containers/mysql-galera:e2e
Expand Down
1 change: 0 additions & 1 deletion test/e2e/testing-manifests/petset/redis/petset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ spec:
}
]'
spec:
terminationGracePeriodSeconds: 0
containers:
- name: redis
image: debian:jessie
Expand Down
1 change: 0 additions & 1 deletion test/e2e/testing-manifests/petset/zookeeper/petset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ spec:
}
]'
spec:
terminationGracePeriodSeconds: 0
containers:
- name: zk
image: java:openjdk-8-jre
Expand Down