From c7497122525c96d66a714ae2d8d6da9b79b6a851 Mon Sep 17 00:00:00 2001 From: henryZrncik Date: Fri, 30 Aug 2024 20:34:04 +0200 Subject: [PATCH] [ST] enable most of formerly kraftNotEnabled tests (#10521) Signed-off-by: hzrncik --- .../systemtest/mirrormaker/MirrorMaker2ST.java | 2 -- .../operators/MultipleClusterOperatorsST.java | 2 -- .../strimzi/systemtest/operators/RecoveryST.java | 14 ++++++++------ .../systemtest/rollingupdate/KafkaRollerST.java | 7 +++---- .../systemtest/rollingupdate/RollingUpdateST.java | 1 - 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/systemtest/src/test/java/io/strimzi/systemtest/mirrormaker/MirrorMaker2ST.java b/systemtest/src/test/java/io/strimzi/systemtest/mirrormaker/MirrorMaker2ST.java index 1e1aa607325..a079993d200 100644 --- a/systemtest/src/test/java/io/strimzi/systemtest/mirrormaker/MirrorMaker2ST.java +++ b/systemtest/src/test/java/io/strimzi/systemtest/mirrormaker/MirrorMaker2ST.java @@ -21,7 +21,6 @@ import io.strimzi.systemtest.AbstractST; import io.strimzi.systemtest.Environment; import io.strimzi.systemtest.TestConstants; -import io.strimzi.systemtest.annotations.KRaftNotSupported; import io.strimzi.systemtest.annotations.ParallelNamespaceTest; import io.strimzi.systemtest.cli.KafkaCmdClient; import io.strimzi.systemtest.kafkaclients.internalClients.KafkaClients; @@ -711,7 +710,6 @@ void testStrimziIdentityReplicationPolicy() { } @ParallelNamespaceTest - @KRaftNotSupported("This the is failing with KRaft and need more investigation") void testRestoreOffsetsInConsumerGroup() { final TestStorage testStorage = new TestStorage(ResourceManager.getTestContext()); diff --git a/systemtest/src/test/java/io/strimzi/systemtest/operators/MultipleClusterOperatorsST.java b/systemtest/src/test/java/io/strimzi/systemtest/operators/MultipleClusterOperatorsST.java index 7bdd7cca811..3ffc18063e4 100644 --- a/systemtest/src/test/java/io/strimzi/systemtest/operators/MultipleClusterOperatorsST.java +++ b/systemtest/src/test/java/io/strimzi/systemtest/operators/MultipleClusterOperatorsST.java @@ -18,7 +18,6 @@ import io.strimzi.systemtest.Environment; import io.strimzi.systemtest.TestConstants; import io.strimzi.systemtest.annotations.IsolatedTest; -import io.strimzi.systemtest.annotations.KRaftNotSupported; import io.strimzi.systemtest.kafkaclients.internalClients.KafkaClients; import io.strimzi.systemtest.resources.NamespaceManager; import io.strimzi.systemtest.resources.NodePoolsConverter; @@ -253,7 +252,6 @@ void testMultipleCOsInDifferentNamespaces() { */ @IsolatedTest @Tag(CRUISE_CONTROL) - @KRaftNotSupported("The scaling of the Kafka Pods is not working properly at the moment") void testKafkaCCAndRebalanceWithMultipleCOs() { assumeFalse(Environment.isNamespaceRbacScope()); final TestStorage testStorage = new TestStorage(ResourceManager.getTestContext(), DEFAULT_NAMESPACE); diff --git a/systemtest/src/test/java/io/strimzi/systemtest/operators/RecoveryST.java b/systemtest/src/test/java/io/strimzi/systemtest/operators/RecoveryST.java index 131b1d95760..d7e34a76f18 100644 --- a/systemtest/src/test/java/io/strimzi/systemtest/operators/RecoveryST.java +++ b/systemtest/src/test/java/io/strimzi/systemtest/operators/RecoveryST.java @@ -209,7 +209,6 @@ private void verifyStabilityBySendingAndReceivingMessages(TestStorage testStorag } @IsolatedTest - @KRaftNotSupported("Zookeeper is not supported by KRaft mode and is used in this test class") void testRecoveryFromKafkaAndZookeeperPodDeletion() { final String kafkaStrimziPodSet = StrimziPodSetResource.getBrokerComponentName(sharedClusterName); final String zkName = KafkaResources.zookeeperComponentName(sharedClusterName); @@ -217,15 +216,18 @@ void testRecoveryFromKafkaAndZookeeperPodDeletion() { final LabelSelector brokerSelector = KafkaResource.getLabelSelector(sharedClusterName, kafkaStrimziPodSet); final LabelSelector controllerSelector = KafkaResource.getLabelSelector(sharedClusterName, zkName); - LOGGER.info("Deleting most of the Kafka and ZK Pods"); + LOGGER.info("Deleting most of the Kafka pods"); List kafkaPodList = kubeClient().listPods(brokerSelector); - List zkPodList = kubeClient().listPods(controllerSelector); - kafkaPodList.subList(0, kafkaPodList.size() - 1).forEach(pod -> kubeClient().deletePod(pod)); - zkPodList.subList(0, zkPodList.size() - 1).forEach(pod -> kubeClient().deletePod(pod)); + + if (!Environment.isKRaftModeEnabled()) { + LOGGER.info("Deleting most of the Zookeeper pods"); + List zkPodList = kubeClient().listPods(controllerSelector); + zkPodList.subList(0, zkPodList.size() - 1).forEach(pod -> kubeClient().deletePod(pod)); + StrimziPodSetUtils.waitForAllStrimziPodSetAndPodsReady(Environment.TEST_SUITE_NAMESPACE, sharedClusterName, zkName, ZOOKEEPER_REPLICAS); + } StrimziPodSetUtils.waitForAllStrimziPodSetAndPodsReady(Environment.TEST_SUITE_NAMESPACE, sharedClusterName, kafkaStrimziPodSet, KAFKA_REPLICAS); - StrimziPodSetUtils.waitForAllStrimziPodSetAndPodsReady(Environment.TEST_SUITE_NAMESPACE, sharedClusterName, zkName, ZOOKEEPER_REPLICAS); KafkaUtils.waitForKafkaReady(Environment.TEST_SUITE_NAMESPACE, sharedClusterName); } diff --git a/systemtest/src/test/java/io/strimzi/systemtest/rollingupdate/KafkaRollerST.java b/systemtest/src/test/java/io/strimzi/systemtest/rollingupdate/KafkaRollerST.java index 720618efe6b..837b724e752 100644 --- a/systemtest/src/test/java/io/strimzi/systemtest/rollingupdate/KafkaRollerST.java +++ b/systemtest/src/test/java/io/strimzi/systemtest/rollingupdate/KafkaRollerST.java @@ -28,7 +28,6 @@ import io.strimzi.systemtest.AbstractST; import io.strimzi.systemtest.Environment; import io.strimzi.systemtest.TestConstants; -import io.strimzi.systemtest.annotations.KRaftNotSupported; import io.strimzi.systemtest.annotations.ParallelNamespaceTest; import io.strimzi.systemtest.kafkaclients.internalClients.KafkaClients; import io.strimzi.systemtest.kafkaclients.internalClients.KafkaClientsBuilder; @@ -80,7 +79,6 @@ public class KafkaRollerST extends AbstractST { private static final Logger LOGGER = LogManager.getLogger(KafkaRollerST.class); @ParallelNamespaceTest - @KRaftNotSupported void testKafkaDoesNotRollsWhenTopicIsUnderReplicated() { final TestStorage testStorage = new TestStorage(ResourceManager.getTestContext()); Instant startTime = Instant.now(); @@ -132,8 +130,9 @@ void testKafkaDoesNotRollsWhenTopicIsUnderReplicated() { KafkaTopic kafkaTopicWith4Replicas = KafkaTopicTemplates.topic(testStorage.getNamespaceName(), topicNameWith4Replicas, testStorage.getClusterName(), 1, 4, 4).build(); resourceManager.createResourceWithWait(kafkaTopicWith4Replicas); - //Test that the new pod does not have errors or failures in events - String uid = kubeClient(testStorage.getNamespaceName()).getPodUid(KafkaResource.getKafkaPodName(testStorage.getClusterName(), KafkaNodePoolResource.getBrokerPoolName(testStorage.getClusterName()), 3)); + // last pod has index 3 (as it is 4th) or 6 (being 7th) as there are also 3 controllers + final int scaledBrokerPodIndex = !Environment.isKRaftModeEnabled() ? 3 : 6; + String uid = kubeClient(testStorage.getNamespaceName()).getPodUid(KafkaResource.getKafkaPodName(testStorage.getClusterName(), KafkaNodePoolResource.getBrokerPoolName(testStorage.getClusterName()), scaledBrokerPodIndex)); List events = kubeClient(testStorage.getNamespaceName()).listEventsByResourceUid(uid); assertThat(events, hasAllOfReasons(Scheduled, Pulled, Created, Started)); diff --git a/systemtest/src/test/java/io/strimzi/systemtest/rollingupdate/RollingUpdateST.java b/systemtest/src/test/java/io/strimzi/systemtest/rollingupdate/RollingUpdateST.java index 1013896b3cf..e7240503233 100644 --- a/systemtest/src/test/java/io/strimzi/systemtest/rollingupdate/RollingUpdateST.java +++ b/systemtest/src/test/java/io/strimzi/systemtest/rollingupdate/RollingUpdateST.java @@ -306,7 +306,6 @@ void testRecoveryDuringKRaftRollingUpdate() { @ParallelNamespaceTest @Tag(ACCEPTANCE) @Tag(COMPONENT_SCALING) - @KRaftNotSupported("The scaling of the Kafka Pods is not working properly at the moment, topic with extra operators will also need a workaround") void testKafkaScaleUpScaleDown() { final TestStorage testStorage = new TestStorage(ResourceManager.getTestContext());