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

Update [Feature:PetSet] e2e tests to [Feature:StatefulSet] #37243

Merged
merged 2 commits into from Nov 23, 2016
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
4 changes: 2 additions & 2 deletions test/e2e/network_partition.go
Expand Up @@ -383,7 +383,7 @@ var _ = framework.KubeDescribe("Network Partition [Disruptive] [Slow]", func() {
deleteAllStatefulSets(c, ns)
})

It("should come back up if node goes down [Slow] [Disruptive] [Feature:PetSet]", func() {
It("should come back up if node goes down [Slow] [Disruptive]", func() {
petMounts := []api.VolumeMount{{Name: "datadir", MountPath: "/data/"}}
podMounts := []api.VolumeMount{{Name: "home", MountPath: "/home"}}
ps := newStatefulSet(psName, ns, headlessSvcName, 3, petMounts, podMounts, labels)
Expand All @@ -401,7 +401,7 @@ var _ = framework.KubeDescribe("Network Partition [Disruptive] [Slow]", func() {
pst.waitForRunningAndReady(ps.Spec.Replicas, ps)
})

It("should not reschedule pets if there is a network partition [Slow] [Disruptive] [Feature:PetSet]", func() {
It("should not reschedule pets if there is a network partition [Slow] [Disruptive]", func() {
ps := newStatefulSet(psName, ns, headlessSvcName, 3, []api.VolumeMount{}, []api.VolumeMount{}, labels)
_, err := c.Apps().StatefulSets(ns).Create(ps)
Expect(err).NotTo(HaveOccurred())
Expand Down
29 changes: 14 additions & 15 deletions test/e2e/petset.go
Expand Up @@ -64,10 +64,9 @@ const (
readTimeout = 60 * time.Second
)

// Time: 25m, slow by design.
// GCE Quota requirements: 3 pds, one per pet manifest declared above.
// GCE Api requirements: nodes and master need storage r/w permissions.
var _ = framework.KubeDescribe("StatefulSet [Slow] [Feature:PetSet]", func() {
var _ = framework.KubeDescribe("StatefulSet", func() {
f := framework.NewDefaultFramework("statefulset")
var ns string
var c clientset.Interface
Expand Down Expand Up @@ -106,7 +105,7 @@ var _ = framework.KubeDescribe("StatefulSet [Slow] [Feature:PetSet]", func() {
deleteAllStatefulSets(c, ns)
})

It("should provide basic identity [Feature:StatefulSet]", func() {
It("should provide basic identity", func() {
By("Creating statefulset " + psName + " in namespace " + ns)
ps.Spec.Replicas = 3
setInitializedAnnotation(ps, "false")
Expand All @@ -116,7 +115,7 @@ var _ = framework.KubeDescribe("StatefulSet [Slow] [Feature:PetSet]", func() {

pst := statefulSetTester{c: c}

By("Saturating pet set " + ps.Name)
By("Saturating stateful set " + ps.Name)
pst.saturate(ps)

By("Verifying statefulset mounted data directory is usable")
Expand All @@ -141,7 +140,7 @@ var _ = framework.KubeDescribe("StatefulSet [Slow] [Feature:PetSet]", func() {
ExpectNoError(pst.execInPets(ps, cmd))
})

It("should handle healthy pet restarts during scale [Feature:PetSet]", func() {
It("should handle healthy pet restarts during scale", func() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

References "pet", but I can see other places in this file where that is the case as well. Do we want to change the wording in a follow-up later on?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I can change this in this PR, in a separate commit

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed my mind, this will be a follow-up PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #37330

By("Creating statefulset " + psName + " in namespace " + ns)
ps.Spec.Replicas = 2
setInitializedAnnotation(ps, "false")
Expand Down Expand Up @@ -348,7 +347,7 @@ var _ = framework.KubeDescribe("StatefulSet [Slow] [Feature:PetSet]", func() {
})
})

framework.KubeDescribe("Deploy clustered applications [Slow] [Feature:PetSet]", func() {
framework.KubeDescribe("Deploy clustered applications [Feature:StatefulSet] [Slow]", func() {
var pst *statefulSetTester
var appTester *clusterAppTester

Expand All @@ -365,29 +364,29 @@ var _ = framework.KubeDescribe("StatefulSet [Slow] [Feature:PetSet]", func() {
deleteAllStatefulSets(c, ns)
})

It("should creating a working zookeeper cluster [Feature:PetSet]", func() {
It("should creating a working zookeeper cluster", func() {
appTester.pet = &zookeeperTester{tester: pst}
appTester.run()
})

It("should creating a working redis cluster [Feature:PetSet]", func() {
It("should creating a working redis cluster", func() {
appTester.pet = &redisTester{tester: pst}
appTester.run()
})

It("should creating a working mysql cluster [Feature:PetSet]", func() {
It("should creating a working mysql cluster", func() {
appTester.pet = &mysqlGaleraTester{tester: pst}
appTester.run()
})

It("should creating a working CockroachDB cluster [Feature:PetSet]", func() {
It("should creating a working CockroachDB cluster", func() {
appTester.pet = &cockroachDBTester{tester: pst}
appTester.run()
})
})
})

var _ = framework.KubeDescribe("Pet set recreate [Slow] [Feature:PetSet]", func() {
var _ = framework.KubeDescribe("Stateful Set recreate", func() {
f := framework.NewDefaultFramework("pet-set-recreate")
var c clientset.Interface
var ns string
Expand Down Expand Up @@ -420,7 +419,7 @@ var _ = framework.KubeDescribe("Pet set recreate [Slow] [Feature:PetSet]", func(
})

It("should recreate evicted statefulset", func() {
By("looking for a node to schedule pet set and pod")
By("looking for a node to schedule stateful set and pod")
nodes := framework.GetReadySchedulableNodesOrDie(f.ClientSet)
node := nodes.Items[0]

Expand Down Expand Up @@ -461,7 +460,7 @@ var _ = framework.KubeDescribe("Pet set recreate [Slow] [Feature:PetSet]", func(
By("waiting until pet pod " + petPodName + " will be recreated and deleted at least once in namespace " + f.Namespace.Name)
w, err := f.ClientSet.Core().Pods(f.Namespace.Name).Watch(api.SingleObject(api.ObjectMeta{Name: petPodName}))
framework.ExpectNoError(err)
// we need to get UID from pod in any state and wait until pet set controller will remove pod atleast once
// we need to get UID from pod in any state and wait until stateful set controller will remove pod atleast once
_, err = watch.Until(petPodTimeout, w, func(event watch.Event) (bool, error) {
pod := event.Object.(*api.Pod)
switch event.Type {
Expand Down Expand Up @@ -984,13 +983,13 @@ func (p *statefulSetTester) waitForStatus(ps *apps.StatefulSet, expectedReplicas
return false, err
}
if psGet.Status.Replicas != expectedReplicas {
framework.Logf("Waiting for pet set status to become %d, currently %d", expectedReplicas, psGet.Status.Replicas)
framework.Logf("Waiting for stateful set status to become %d, currently %d", expectedReplicas, psGet.Status.Replicas)
return false, nil
}
return true, nil
})
if pollErr != nil {
framework.Failf("Failed waiting for pet set status.replicas updated to %d: %v", expectedReplicas, pollErr)
framework.Failf("Failed waiting for stateful set status.replicas updated to %d: %v", expectedReplicas, pollErr)
}
}

Expand Down