Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

E2E: ensure long-running-apache hpa doesn’t already exist before creating #4232

Merged
merged 2 commits into from
Nov 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion test/e2e/kubernetes/kubernetes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,13 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu

It("should be able to autoscale", func() {
if eng.HasLinuxAgents() && eng.ExpandedDefinition.Properties.OrchestratorProfile.KubernetesConfig.EnableAggregatedAPIs {
// "Pre"-delete the hpa in case a prior delete attempt failed, for long-running cluster scenarios
h, err := hpa.Get(longRunningApacheDeploymentName, "default")
if err == nil {
h.Delete(deleteResourceRetries)
// Wait a minute before proceeding to create a new hpa w/ the same name
time.Sleep(1 * time.Minute)
}
By("Getting the long-running php-apache deployment")
// Inspired by http://blog.kubernetes.io/2016/07/autoscaling-in-kubernetes.html
r := rand.New(rand.NewSource(time.Now().UnixNano()))
Expand Down Expand Up @@ -627,7 +634,7 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
By("Ensuring we only have 1 apache-php pod after stopping load")
_, err = phpApacheDeploy.WaitForReplicas(-1, 1, 5*time.Second, cfg.Timeout)
Expect(err).NotTo(HaveOccurred())
h, err := hpa.Get(longRunningApacheDeploymentName, "default")
h, err = hpa.Get(longRunningApacheDeploymentName, "default")
Expect(err).NotTo(HaveOccurred())

By("Deleting HPA configuration")
Expand Down