diff --git a/controllers/activemqartemis_reconciler.go b/controllers/activemqartemis_reconciler.go index e4423e707..e6c7243a0 100644 --- a/controllers/activemqartemis_reconciler.go +++ b/controllers/activemqartemis_reconciler.go @@ -1971,8 +1971,7 @@ var command = []string{ var betterCommand = []string{ "/bin/bash", "-c", - "/opt/amq/bin/readinessProbe.sh", - "1", // retries/count - so we get fast feedback and can configure via the Probe + "/opt/amq/bin/readinessProbe.sh 1", // retries/count - so we get fast feedback and can configure via the Probe // "1", sleep seconds not applicable with 1 retry } diff --git a/controllers/activemqartemisscaledown_controller_test.go b/controllers/activemqartemisscaledown_controller_test.go index 153dd7645..a40fd5fd4 100644 --- a/controllers/activemqartemisscaledown_controller_test.go +++ b/controllers/activemqartemisscaledown_controller_test.go @@ -61,9 +61,18 @@ var _ = Describe("Scale down controller", func() { brokerCrd.Spec.DeploymentPlan.Clustered = &booleanTrue brokerCrd.Spec.DeploymentPlan.Size = common.Int32ToPtr(2) brokerCrd.Spec.DeploymentPlan.PersistenceEnabled = true + // scale down is very sensitive to dns availability of ordinal 0 brokerCrd.Spec.DeploymentPlan.ReadinessProbe = &corev1.Probe{ - InitialDelaySeconds: 1, + InitialDelaySeconds: 2, + TimeoutSeconds: 2, PeriodSeconds: 5, + FailureThreshold: 5, + } + brokerCrd.Spec.DeploymentPlan.LivenessProbe = &corev1.Probe{ + InitialDelaySeconds: 2, + TimeoutSeconds: 2, + PeriodSeconds: 5, + FailureThreshold: 5, } Expect(k8sClient.Create(ctx, brokerCrd)).Should(Succeed()) @@ -114,6 +123,9 @@ var _ = Describe("Scale down controller", func() { queryCmd := []string{"amq-broker/bin/artemis", "queue", "stat", "--silent", "--url", "tcp://" + podWithOrdinal + ":61616", "--queueName", "DLQ"} stdout, err := RunCommandInPod(podWithOrdinal, brokerName+"-container", queryCmd) g.Expect(err).To(BeNil()) + if verbose { + fmt.Printf("\nQSTAT_OUTPUT: %v\n", *stdout) + } fields := strings.Split(*stdout, "|") g.Expect(fields[4]).To(Equal("MESSAGE_COUNT"), *stdout) g.Expect(strings.TrimSpace(fields[14])).To(Equal("1"), *stdout)