use of io.strimzi.systemtest.annotations.StrimziPodSetTest in project strimzi by strimzi.
the class RecoveryIsolatedST method testRecoveryFromKafkaAndZookeeperPodDeletion.
@IsolatedTest
@StrimziPodSetTest
@KRaftNotSupported("Zookeeper is not supported by KRaft mode and is used in this test class")
void testRecoveryFromKafkaAndZookeeperPodDeletion() {
final String kafkaName = KafkaResources.kafkaStatefulSetName(sharedClusterName);
final String zkName = KafkaResources.zookeeperStatefulSetName(sharedClusterName);
final LabelSelector kafkaSelector = KafkaResource.getLabelSelector(sharedClusterName, kafkaName);
final LabelSelector zkSelector = KafkaResource.getLabelSelector(sharedClusterName, zkName);
LOGGER.info("Deleting most of the Kafka and ZK pods");
List<Pod> kafkaPodList = kubeClient().listPods(kafkaSelector);
List<Pod> zkPodList = kubeClient().listPods(zkSelector);
kafkaPodList.subList(0, kafkaPodList.size() - 1).forEach(pod -> kubeClient().deletePod(pod));
zkPodList.subList(0, zkPodList.size() - 1).forEach(pod -> kubeClient().deletePod(pod));
StrimziPodSetUtils.waitForAllStrimziPodSetAndPodsReady(kafkaName, KAFKA_REPLICAS);
StrimziPodSetUtils.waitForAllStrimziPodSetAndPodsReady(zkName, ZOOKEEPER_REPLICAS);
KafkaUtils.waitForKafkaReady(sharedClusterName);
}
use of io.strimzi.systemtest.annotations.StrimziPodSetTest in project strimzi-kafka-operator by strimzi.
the class RecoveryIsolatedST method testRecoveryFromKafkaAndZookeeperPodDeletion.
@IsolatedTest
@StrimziPodSetTest
@KRaftNotSupported("Zookeeper is not supported by KRaft mode and is used in this test class")
void testRecoveryFromKafkaAndZookeeperPodDeletion() {
final String kafkaName = KafkaResources.kafkaStatefulSetName(sharedClusterName);
final String zkName = KafkaResources.zookeeperStatefulSetName(sharedClusterName);
final LabelSelector kafkaSelector = KafkaResource.getLabelSelector(sharedClusterName, kafkaName);
final LabelSelector zkSelector = KafkaResource.getLabelSelector(sharedClusterName, zkName);
LOGGER.info("Deleting most of the Kafka and ZK pods");
List<Pod> kafkaPodList = kubeClient().listPods(kafkaSelector);
List<Pod> zkPodList = kubeClient().listPods(zkSelector);
kafkaPodList.subList(0, kafkaPodList.size() - 1).forEach(pod -> kubeClient().deletePod(pod));
zkPodList.subList(0, zkPodList.size() - 1).forEach(pod -> kubeClient().deletePod(pod));
StrimziPodSetUtils.waitForAllStrimziPodSetAndPodsReady(kafkaName, KAFKA_REPLICAS);
StrimziPodSetUtils.waitForAllStrimziPodSetAndPodsReady(zkName, ZOOKEEPER_REPLICAS);
KafkaUtils.waitForKafkaReady(sharedClusterName);
}
Aggregations