Skip to content

Commit 644aa7a

Browse files
committed
Revert "Add test for handling OOMing containers"
This reverts commit 3e6d8f1.
1 parent 68c12d3 commit 644aa7a

File tree

6 files changed

+11
-165
lines changed

6 files changed

+11
-165
lines changed

vertical-pod-autoscaler/e2e/v1/autoscaling_utils.go

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ const (
6060
customMetricName = "QPS"
6161
serviceInitializationTimeout = 2 * time.Minute
6262
serviceInitializationInterval = 15 * time.Second
63-
// TODO(jbartosik): put the image in a VPA project
64-
stressImage = "gcr.io/jbartosik-gke-dev/stress:0.10"
6563
)
6664

6765
var (
@@ -365,7 +363,7 @@ func runServiceAndWorkloadForResourceConsumer(c clientset.Interface, ns, name st
365363
Timeout: timeoutRC,
366364
Replicas: replicas,
367365
CpuRequest: cpuRequestMillis,
368-
MemRequest: memRequestMb * 1024 * 1024, // Mem Request is in bytes
366+
MemRequest: memRequestMb * 1024 * 1024, // MemLimit is in bytes
369367
Annotations: podAnnotations,
370368
}
371369

@@ -429,25 +427,3 @@ func runServiceAndWorkloadForResourceConsumer(c clientset.Interface, ns, name st
429427
framework.ExpectNoError(framework.WaitForServiceEndpointsNum(
430428
c, ns, controllerName, 1, startServiceInterval, startServiceTimeout))
431429
}
432-
433-
func runOomingReplicationController(c clientset.Interface, ns, name string, replicas int) {
434-
ginkgo.By(fmt.Sprintf("Running OOMing RC %s with %v replicas", name, replicas))
435-
436-
rcConfig := testutils.RCConfig{
437-
Client: c,
438-
Image: stressImage,
439-
Name: name,
440-
Namespace: ns,
441-
Timeout: timeoutRC,
442-
Replicas: replicas,
443-
Annotations: make(map[string]string),
444-
}
445-
446-
dpConfig := testutils.DeploymentConfig{
447-
RCConfig: rcConfig,
448-
}
449-
ginkgo.By(fmt.Sprintf("Creating deployment %s in namespace %s", dpConfig.Name, dpConfig.Namespace))
450-
dpConfig.NodeDumpFunc = framework.DumpNodeDebugInfo
451-
dpConfig.ContainerDumpFunc = framework.LogFailedContainers
452-
framework.ExpectNoError(testutils.RunDeployment(dpConfig))
453-
}

vertical-pod-autoscaler/e2e/v1/common.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,17 +192,12 @@ func NewHamsterDeploymentWithResourcesAndLimits(f *framework.Framework, cpuQuant
192192
return d
193193
}
194194

195-
func getPodSelectorExcludingDonePodsOrDie() string {
196-
stringSelector := "status.phase!=" + string(apiv1.PodSucceeded) +
197-
",status.phase!=" + string(apiv1.PodFailed)
198-
selector := fields.ParseSelectorOrDie(stringSelector)
199-
return selector.String()
200-
}
201-
202195
// GetHamsterPods returns running hamster pods (matched by hamsterLabels)
203196
func GetHamsterPods(f *framework.Framework) (*apiv1.PodList, error) {
204197
label := labels.SelectorFromSet(labels.Set(hamsterLabels))
205-
options := metav1.ListOptions{LabelSelector: label.String(), FieldSelector: getPodSelectorExcludingDonePodsOrDie()}
198+
selector := fields.ParseSelectorOrDie("status.phase!=" + string(apiv1.PodSucceeded) +
199+
",status.phase!=" + string(apiv1.PodFailed))
200+
options := metav1.ListOptions{LabelSelector: label.String(), FieldSelector: selector.String()}
206201
return f.ClientSet.CoreV1().Pods(f.Namespace.Name).List(options)
207202
}
208203

vertical-pod-autoscaler/e2e/v1/full_vpa.go

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -120,49 +120,6 @@ var _ = FullVpaE2eDescribe("Pods under VPA", func() {
120120
})
121121
})
122122

123-
var _ = FullVpaE2eDescribe("OOMing pods under VPA", func() {
124-
var (
125-
vpaClientSet *vpa_clientset.Clientset
126-
vpaCRD *vpa_types.VerticalPodAutoscaler
127-
)
128-
const replicas = 3
129-
130-
f := framework.NewDefaultFramework("vertical-pod-autoscaling")
131-
132-
ginkgo.BeforeEach(func() {
133-
ns := f.Namespace.Name
134-
ginkgo.By("Setting up a hamster deployment")
135-
136-
runOomingReplicationController(
137-
f.ClientSet,
138-
ns,
139-
"hamster",
140-
replicas)
141-
ginkgo.By("Setting up a VPA CRD")
142-
config, err := framework.LoadConfig()
143-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
144-
145-
vpaCRD = NewVPA(f, "hamster-vpa", &autoscaling.CrossVersionObjectReference{
146-
APIVersion: "v1",
147-
Kind: "Deployment",
148-
Name: "hamster",
149-
})
150-
151-
vpaClientSet = vpa_clientset.NewForConfigOrDie(config)
152-
vpaClient := vpaClientSet.AutoscalingV1()
153-
_, err = vpaClient.VerticalPodAutoscalers(ns).Create(vpaCRD)
154-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
155-
})
156-
157-
ginkgo.It("have memory requests growing with OOMs", func() {
158-
listOptions := metav1.ListOptions{LabelSelector: "name=hamster", FieldSelector: getPodSelectorExcludingDonePodsOrDie()}
159-
err := waitForResourceRequestInRangeInPods(
160-
f, listOptions, apiv1.ResourceMemory,
161-
ParseQuantityOrDie("1400Mi"), ParseQuantityOrDie("10000Mi"))
162-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
163-
})
164-
})
165-
166123
func waitForPodsMatch(f *framework.Framework, listOptions metav1.ListOptions, matcher func(pod apiv1.Pod) bool) error {
167124
return wait.PollImmediate(pollInterval, pollTimeout, func() (bool, error) {
168125

@@ -178,17 +135,12 @@ func waitForPodsMatch(f *framework.Framework, listOptions metav1.ListOptions, ma
178135
return false, nil
179136
}
180137

181-
// Run matcher on all pods, even if we find pod that doesn't match early.
182-
// This allows the matcher to write logs for all pods. This in turns makes
183-
// it easier to spot some problems (for example unexpected pods in the list
184-
// results).
185-
result := true
186138
for _, pod := range podList.Items {
187139
if !matcher(pod) {
188-
result = false
140+
return false, nil
189141
}
190142
}
191-
return result, nil
143+
return true, nil
192144

193145
})
194146
}

vertical-pod-autoscaler/e2e/v1beta2/autoscaling_utils.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ const (
6060
customMetricName = "QPS"
6161
serviceInitializationTimeout = 2 * time.Minute
6262
serviceInitializationInterval = 15 * time.Second
63-
// TODO(jbartosik): put the image in a VPA project
64-
stressImage = "gcr.io/jbartosik-gke-dev/stress:0.10"
6563
)
6664

6765
var (
@@ -429,25 +427,3 @@ func runServiceAndWorkloadForResourceConsumer(c clientset.Interface, ns, name st
429427
framework.ExpectNoError(framework.WaitForServiceEndpointsNum(
430428
c, ns, controllerName, 1, startServiceInterval, startServiceTimeout))
431429
}
432-
433-
func runOomingReplicationController(c clientset.Interface, ns, name string, replicas int) {
434-
ginkgo.By(fmt.Sprintf("Running OOMing RC %s with %v replicas", name, replicas))
435-
436-
rcConfig := testutils.RCConfig{
437-
Client: c,
438-
Image: stressImage,
439-
Name: name,
440-
Namespace: ns,
441-
Timeout: timeoutRC,
442-
Replicas: replicas,
443-
Annotations: make(map[string]string),
444-
}
445-
446-
dpConfig := testutils.DeploymentConfig{
447-
RCConfig: rcConfig,
448-
}
449-
ginkgo.By(fmt.Sprintf("Creating deployment %s in namespace %s", dpConfig.Name, dpConfig.Namespace))
450-
dpConfig.NodeDumpFunc = framework.DumpNodeDebugInfo
451-
dpConfig.ContainerDumpFunc = framework.LogFailedContainers
452-
framework.ExpectNoError(testutils.RunDeployment(dpConfig))
453-
}

vertical-pod-autoscaler/e2e/v1beta2/common.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,17 +192,12 @@ func NewHamsterDeploymentWithResourcesAndLimits(f *framework.Framework, cpuQuant
192192
return d
193193
}
194194

195-
func getPodSelectorExcludingDonePodsOrDie() string {
196-
stringSelector := "status.phase!=" + string(apiv1.PodSucceeded) +
197-
",status.phase!=" + string(apiv1.PodFailed)
198-
selector := fields.ParseSelectorOrDie(stringSelector)
199-
return selector.String()
200-
}
201-
202195
// GetHamsterPods returns running hamster pods (matched by hamsterLabels)
203196
func GetHamsterPods(f *framework.Framework) (*apiv1.PodList, error) {
204197
label := labels.SelectorFromSet(labels.Set(hamsterLabels))
205-
options := metav1.ListOptions{LabelSelector: label.String(), FieldSelector: getPodSelectorExcludingDonePodsOrDie()}
198+
selector := fields.ParseSelectorOrDie("status.phase!=" + string(apiv1.PodSucceeded) +
199+
",status.phase!=" + string(apiv1.PodFailed))
200+
options := metav1.ListOptions{LabelSelector: label.String(), FieldSelector: selector.String()}
206201
return f.ClientSet.CoreV1().Pods(f.Namespace.Name).List(options)
207202
}
208203

vertical-pod-autoscaler/e2e/v1beta2/full_vpa.go

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -120,49 +120,6 @@ var _ = FullVpaE2eDescribe("Pods under VPA", func() {
120120
})
121121
})
122122

123-
var _ = FullVpaE2eDescribe("OOMing pods under VPA", func() {
124-
var (
125-
vpaClientSet *vpa_clientset.Clientset
126-
vpaCRD *vpa_types.VerticalPodAutoscaler
127-
)
128-
const replicas = 3
129-
130-
f := framework.NewDefaultFramework("vertical-pod-autoscaling")
131-
132-
ginkgo.BeforeEach(func() {
133-
ns := f.Namespace.Name
134-
ginkgo.By("Setting up a hamster deployment")
135-
136-
runOomingReplicationController(
137-
f.ClientSet,
138-
ns,
139-
"hamster",
140-
replicas)
141-
ginkgo.By("Setting up a VPA CRD")
142-
config, err := framework.LoadConfig()
143-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
144-
145-
vpaCRD = NewVPA(f, "hamster-vpa", &autoscaling.CrossVersionObjectReference{
146-
APIVersion: "apps/v1",
147-
Kind: "Deployment",
148-
Name: "hamster",
149-
})
150-
151-
vpaClientSet = vpa_clientset.NewForConfigOrDie(config)
152-
vpaClient := vpaClientSet.AutoscalingV1beta2()
153-
_, err = vpaClient.VerticalPodAutoscalers(ns).Create(vpaCRD)
154-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
155-
})
156-
157-
ginkgo.It("have memory requests growing with OOMs", func() {
158-
listOptions := metav1.ListOptions{LabelSelector: "name=hamster", FieldSelector: getPodSelectorExcludingDonePodsOrDie()}
159-
err := waitForResourceRequestInRangeInPods(
160-
f, listOptions, apiv1.ResourceMemory,
161-
ParseQuantityOrDie("1400Mi"), ParseQuantityOrDie("10000Mi"))
162-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
163-
})
164-
})
165-
166123
func waitForPodsMatch(f *framework.Framework, listOptions metav1.ListOptions, matcher func(pod apiv1.Pod) bool) error {
167124
return wait.PollImmediate(pollInterval, pollTimeout, func() (bool, error) {
168125

@@ -178,17 +135,12 @@ func waitForPodsMatch(f *framework.Framework, listOptions metav1.ListOptions, ma
178135
return false, nil
179136
}
180137

181-
// Run matcher on all pods, even if we find pod that doesn't match early.
182-
// This allows the matcher to write logs for all pods. This in turns makes
183-
// it easier to spot some problems (for example unexpected pods in the list
184-
// results).
185-
result := true
186138
for _, pod := range podList.Items {
187139
if !matcher(pod) {
188-
result = false
140+
return false, nil
189141
}
190142
}
191-
return result, nil
143+
return true, nil
192144

193145
})
194146
}

0 commit comments

Comments
 (0)