From 7cf5bae5e5c39214a86fba3629d0d143e65704b0 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Mon, 27 Oct 2025 16:19:50 +0100 Subject: [PATCH 1/4] test: raise kraft timeouts --- .../templates/kuttl/operations-kraft/20-install-kafka.yaml.j2 | 2 +- tests/templates/kuttl/operations-kraft/25-assert.yaml.j2 | 2 +- tests/templates/kuttl/operations-kraft/25-pause-kafka.yaml.j2 | 2 +- tests/templates/kuttl/operations-kraft/30-stop-kafka.yaml.j2 | 2 +- tests/templates/kuttl/operations-kraft/50-assert.yaml.j2 | 2 +- .../templates/kuttl/operations-kraft/50-restart-kafka.yaml.j2 | 3 ++- tests/templates/kuttl/operations-kraft/60-assert.yaml.j2 | 2 +- .../kuttl/operations-kraft/60-scale-controller-up.yaml.j2 | 2 +- .../kuttl/operations-kraft/70-assert.yaml.j2.disabled | 2 +- .../operations-kraft/70-scale-controller-down.yaml.j2.disabled | 2 +- 10 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/templates/kuttl/operations-kraft/20-install-kafka.yaml.j2 b/tests/templates/kuttl/operations-kraft/20-install-kafka.yaml.j2 index 655d26a5..fd95c8ef 100644 --- a/tests/templates/kuttl/operations-kraft/20-install-kafka.yaml.j2 +++ b/tests/templates/kuttl/operations-kraft/20-install-kafka.yaml.j2 @@ -1,7 +1,7 @@ --- apiVersion: kuttl.dev/v1beta1 kind: TestStep -timeout: 300 +timeout: 600 --- apiVersion: kafka.stackable.tech/v1alpha1 kind: KafkaCluster diff --git a/tests/templates/kuttl/operations-kraft/25-assert.yaml.j2 b/tests/templates/kuttl/operations-kraft/25-assert.yaml.j2 index 9ba36657..a83fcb5b 100644 --- a/tests/templates/kuttl/operations-kraft/25-assert.yaml.j2 +++ b/tests/templates/kuttl/operations-kraft/25-assert.yaml.j2 @@ -1,7 +1,7 @@ --- apiVersion: kuttl.dev/v1beta1 kind: TestAssert -timeout: 300 +timeout: 600 commands: - script: kubectl -n $NAMESPACE wait --for=condition=reconciliationPaused kafkaclusters.kafka.stackable.tech/test-kafka --timeout 301s --- diff --git a/tests/templates/kuttl/operations-kraft/25-pause-kafka.yaml.j2 b/tests/templates/kuttl/operations-kraft/25-pause-kafka.yaml.j2 index 0e851efa..2be3f573 100644 --- a/tests/templates/kuttl/operations-kraft/25-pause-kafka.yaml.j2 +++ b/tests/templates/kuttl/operations-kraft/25-pause-kafka.yaml.j2 @@ -1,7 +1,7 @@ --- apiVersion: kuttl.dev/v1beta1 kind: TestStep -timeout: 300 +timeout: 600 --- apiVersion: kafka.stackable.tech/v1alpha1 kind: KafkaCluster diff --git a/tests/templates/kuttl/operations-kraft/30-stop-kafka.yaml.j2 b/tests/templates/kuttl/operations-kraft/30-stop-kafka.yaml.j2 index 70e9f713..b11dd670 100644 --- a/tests/templates/kuttl/operations-kraft/30-stop-kafka.yaml.j2 +++ b/tests/templates/kuttl/operations-kraft/30-stop-kafka.yaml.j2 @@ -1,7 +1,7 @@ --- apiVersion: kuttl.dev/v1beta1 kind: TestStep -timeout: 300 +timeout: 600 --- apiVersion: kafka.stackable.tech/v1alpha1 kind: KafkaCluster diff --git a/tests/templates/kuttl/operations-kraft/50-assert.yaml.j2 b/tests/templates/kuttl/operations-kraft/50-assert.yaml.j2 index ff21429a..321a671d 100644 --- a/tests/templates/kuttl/operations-kraft/50-assert.yaml.j2 +++ b/tests/templates/kuttl/operations-kraft/50-assert.yaml.j2 @@ -1,7 +1,7 @@ --- apiVersion: kuttl.dev/v1beta1 kind: TestAssert -timeout: 300 +timeout: 600 commands: - script: kubectl -n $NAMESPACE wait --for=condition=available kafkaclusters.kafka.stackable.tech/test-kafka --timeout 301s --- diff --git a/tests/templates/kuttl/operations-kraft/50-restart-kafka.yaml.j2 b/tests/templates/kuttl/operations-kraft/50-restart-kafka.yaml.j2 index 758b9e04..16753708 100644 --- a/tests/templates/kuttl/operations-kraft/50-restart-kafka.yaml.j2 +++ b/tests/templates/kuttl/operations-kraft/50-restart-kafka.yaml.j2 @@ -1,7 +1,7 @@ --- apiVersion: kuttl.dev/v1beta1 kind: TestStep -timeout: 300 +timeout: 600 --- apiVersion: kafka.stackable.tech/v1alpha1 kind: KafkaCluster @@ -36,3 +36,4 @@ spec: clusterOperation: stopped: false reconciliationPaused: false +internal/step/step.go diff --git a/tests/templates/kuttl/operations-kraft/60-assert.yaml.j2 b/tests/templates/kuttl/operations-kraft/60-assert.yaml.j2 index 9209b5ea..61968a8a 100644 --- a/tests/templates/kuttl/operations-kraft/60-assert.yaml.j2 +++ b/tests/templates/kuttl/operations-kraft/60-assert.yaml.j2 @@ -2,7 +2,7 @@ --- apiVersion: kuttl.dev/v1beta1 kind: TestAssert -timeout: 300 +timeout: 600 commands: - script: kubectl -n $NAMESPACE wait --for=condition=available kafkaclusters.kafka.stackable.tech/test-kafka --timeout 301s --- diff --git a/tests/templates/kuttl/operations-kraft/60-scale-controller-up.yaml.j2 b/tests/templates/kuttl/operations-kraft/60-scale-controller-up.yaml.j2 index 718c760e..c1b64e7e 100644 --- a/tests/templates/kuttl/operations-kraft/60-scale-controller-up.yaml.j2 +++ b/tests/templates/kuttl/operations-kraft/60-scale-controller-up.yaml.j2 @@ -2,7 +2,7 @@ --- apiVersion: kuttl.dev/v1beta1 kind: TestStep -timeout: 300 +timeout: 600 --- apiVersion: kafka.stackable.tech/v1alpha1 kind: KafkaCluster diff --git a/tests/templates/kuttl/operations-kraft/70-assert.yaml.j2.disabled b/tests/templates/kuttl/operations-kraft/70-assert.yaml.j2.disabled index d8da05ff..cd8c8ae2 100644 --- a/tests/templates/kuttl/operations-kraft/70-assert.yaml.j2.disabled +++ b/tests/templates/kuttl/operations-kraft/70-assert.yaml.j2.disabled @@ -2,7 +2,7 @@ --- apiVersion: kuttl.dev/v1beta1 kind: TestAssert -timeout: 300 +timeout: 600 commands: - script: kubectl -n $NAMESPACE wait --for=condition=available kafkaclusters.kafka.stackable.tech/test-kafka --timeout 301s --- diff --git a/tests/templates/kuttl/operations-kraft/70-scale-controller-down.yaml.j2.disabled b/tests/templates/kuttl/operations-kraft/70-scale-controller-down.yaml.j2.disabled index 136e2b59..c398d99c 100644 --- a/tests/templates/kuttl/operations-kraft/70-scale-controller-down.yaml.j2.disabled +++ b/tests/templates/kuttl/operations-kraft/70-scale-controller-down.yaml.j2.disabled @@ -6,7 +6,7 @@ --- apiVersion: kuttl.dev/v1beta1 kind: TestStep -timeout: 300 +timeout: 600 --- apiVersion: kafka.stackable.tech/v1alpha1 kind: KafkaCluster From 20ee1c3b46f6168895804fa901ec05f0312fdcd6 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Tue, 28 Oct 2025 09:35:20 +0100 Subject: [PATCH 2/4] remove junk line --- tests/templates/kuttl/operations-kraft/50-restart-kafka.yaml.j2 | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/templates/kuttl/operations-kraft/50-restart-kafka.yaml.j2 b/tests/templates/kuttl/operations-kraft/50-restart-kafka.yaml.j2 index 16753708..13a19572 100644 --- a/tests/templates/kuttl/operations-kraft/50-restart-kafka.yaml.j2 +++ b/tests/templates/kuttl/operations-kraft/50-restart-kafka.yaml.j2 @@ -36,4 +36,3 @@ spec: clusterOperation: stopped: false reconciliationPaused: false -internal/step/step.go From fa1f7ef71740f50d65e9638ad3b1023aad01cfc4 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Tue, 28 Oct 2025 12:16:52 +0100 Subject: [PATCH 3/4] raise controller pod probes timeout to 1 minute --- rust/operator-binary/src/resource/statefulset.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rust/operator-binary/src/resource/statefulset.rs b/rust/operator-binary/src/resource/statefulset.rs index 0acf2719..67343518 100644 --- a/rust/operator-binary/src/resource/statefulset.rs +++ b/rust/operator-binary/src/resource/statefulset.rs @@ -693,8 +693,9 @@ pub fn build_controller_rolegroup_statefulset( port: IntOrString::Int(kafka_security.client_port().into()), ..Default::default() }), - timeout_seconds: Some(5), - period_seconds: Some(5), + timeout_seconds: Some(10), + period_seconds: Some(10), + failure_threshold: Some(6), ..Probe::default() }) .readiness_probe(Probe { @@ -702,8 +703,9 @@ pub fn build_controller_rolegroup_statefulset( port: IntOrString::Int(kafka_security.client_port().into()), ..Default::default() }), - timeout_seconds: Some(5), - period_seconds: Some(5), + timeout_seconds: Some(10), + period_seconds: Some(10), + failure_threshold: Some(6), ..Probe::default() }); From 48bf47c54e1c9e8100cc76f6eac48ad8422434f3 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Tue, 28 Oct 2025 13:05:48 +0100 Subject: [PATCH 4/4] re-enable downscale tests and ensure clean ns termination --- ...ert.yaml.j2.disabled => 70-assert.yaml.j2} | 0 ...abled => 70-scale-controller-down.yaml.j2} | 4 -- .../kuttl/operations-kraft/80-assert.yaml.j2 | 21 +++++++++ .../80-scale-broker-down.yaml.j2 | 46 +++++++++++++++++++ 4 files changed, 67 insertions(+), 4 deletions(-) rename tests/templates/kuttl/operations-kraft/{70-assert.yaml.j2.disabled => 70-assert.yaml.j2} (100%) rename tests/templates/kuttl/operations-kraft/{70-scale-controller-down.yaml.j2.disabled => 70-scale-controller-down.yaml.j2} (90%) create mode 100644 tests/templates/kuttl/operations-kraft/80-assert.yaml.j2 create mode 100644 tests/templates/kuttl/operations-kraft/80-scale-broker-down.yaml.j2 diff --git a/tests/templates/kuttl/operations-kraft/70-assert.yaml.j2.disabled b/tests/templates/kuttl/operations-kraft/70-assert.yaml.j2 similarity index 100% rename from tests/templates/kuttl/operations-kraft/70-assert.yaml.j2.disabled rename to tests/templates/kuttl/operations-kraft/70-assert.yaml.j2 diff --git a/tests/templates/kuttl/operations-kraft/70-scale-controller-down.yaml.j2.disabled b/tests/templates/kuttl/operations-kraft/70-scale-controller-down.yaml.j2 similarity index 90% rename from tests/templates/kuttl/operations-kraft/70-scale-controller-down.yaml.j2.disabled rename to tests/templates/kuttl/operations-kraft/70-scale-controller-down.yaml.j2 index c398d99c..ba70a1b5 100644 --- a/tests/templates/kuttl/operations-kraft/70-scale-controller-down.yaml.j2.disabled +++ b/tests/templates/kuttl/operations-kraft/70-scale-controller-down.yaml.j2 @@ -1,7 +1,3 @@ -# -# This test step is disabled becaus Kraft controller do scale down reliably. -# This leads to flaky tests. -# {% if not test_scenario['values']['kafka-kraft'].startswith("3.7") %} --- apiVersion: kuttl.dev/v1beta1 diff --git a/tests/templates/kuttl/operations-kraft/80-assert.yaml.j2 b/tests/templates/kuttl/operations-kraft/80-assert.yaml.j2 new file mode 100644 index 00000000..a1d7088f --- /dev/null +++ b/tests/templates/kuttl/operations-kraft/80-assert.yaml.j2 @@ -0,0 +1,21 @@ +{% if not test_scenario['values']['kafka-kraft'].startswith("3.7") %} +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +timeout: 600 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: test-kafka-broker-default +status: + replicas: 0 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: test-kafka-controller-default +status: + readyReplicas: 3 + replicas: 3 +{% endif %} diff --git a/tests/templates/kuttl/operations-kraft/80-scale-broker-down.yaml.j2 b/tests/templates/kuttl/operations-kraft/80-scale-broker-down.yaml.j2 new file mode 100644 index 00000000..d532d273 --- /dev/null +++ b/tests/templates/kuttl/operations-kraft/80-scale-broker-down.yaml.j2 @@ -0,0 +1,46 @@ +# +# This is a test helper to ensure that all broker pods are deleted before +# the test namespace is terminated. +# The brokers must be deleted because otherwise they are left dangling until +# the test timeouts and fails. +# +{% if not test_scenario['values']['kafka-kraft'].startswith("3.7") %} +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +timeout: 600 +--- +apiVersion: kafka.stackable.tech/v1alpha1 +kind: KafkaCluster +metadata: + name: test-kafka +spec: + image: +{% if test_scenario['values']['kafka-kraft'].find(",") > 0 %} + custom: "{{ test_scenario['values']['kafka-kraft'].split(',')[1] }}" + productVersion: "{{ test_scenario['values']['kafka-kraft'].split(',')[0] }}" +{% else %} + productVersion: "{{ test_scenario['values']['kafka-kraft'] }}" +{% endif %} +{% if lookup('env', 'VECTOR_AGGREGATOR') %} + clusterConfig: + vectorAggregatorConfigMapName: vector-aggregator-discovery +{% endif %} + controllers: + config: + logging: + enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} + roleGroups: + default: + replicas: 3 + brokers: + config: + logging: + enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} + roleGroups: + default: + replicas: 0 + clusterOperation: + stopped: false + reconciliationPaused: false +{% endif %}