@@ -413,7 +413,15 @@ void testKafkaJBODDeleteClaimsTrueFalse() {
413
413
414
414
Map <String , String > brokerPods = PodUtils .podSnapshot (testStorage .getNamespaceName (), testStorage .getBrokerSelector ());
415
415
// kafka cluster already deployed
416
- verifyVolumeNamesAndLabels (testStorage .getNamespaceName (), testStorage .getClusterName (), testStorage .getBrokerComponentName (), kafkaReplicas , 2 , diskSizeGi );
416
+ TestUtils .waitFor ("expected labels on PVCs" , TestConstants .GLOBAL_POLL_INTERVAL_5_SECS , TestConstants .GLOBAL_STATUS_TIMEOUT , () -> {
417
+ try {
418
+ verifyVolumeNamesAndLabels (testStorage .getNamespaceName (), testStorage .getClusterName (), testStorage .getBrokerComponentName (), kafkaReplicas , 2 , diskSizeGi );
419
+ return true ;
420
+ } catch (AssertionError ex ) {
421
+ LOGGER .info ("Some of the expected labels are not in place, rerunning the check..." );
422
+ return false ;
423
+ }
424
+ });
417
425
418
426
//change value of first PVC to delete its claim once Kafka is deleted.
419
427
LOGGER .info ("Update Volume with id=0 in Kafka CR by setting 'Delete Claim' property to false" );
@@ -841,8 +849,16 @@ void testMessagesAndConsumerOffsetFilesOnDisk() {
841
849
String brokerPodName = kubeClient ().listPods (testStorage .getNamespaceName (), testStorage .getBrokerSelector ()).get (0 ).getMetadata ().getName ();
842
850
843
851
TestUtils .waitFor ("KafkaTopic creation inside Kafka Pod" , TestConstants .GLOBAL_POLL_INTERVAL , TestConstants .GLOBAL_TIMEOUT ,
844
- () -> cmdKubeClient (testStorage .getNamespaceName ()).execInPod (brokerPodName , "/bin/bash" ,
845
- "-c" , "cd /var/lib/kafka/data/kafka-log0; ls -1" ).out ().contains (testStorage .getTopicName ()));
852
+ () -> {
853
+ String output = cmdKubeClient (testStorage .getNamespaceName ()).execInPod (brokerPodName , "/bin/bash" ,
854
+ "-c" , "cd /var/lib/kafka/data/kafka-log0; ls -1" ).out ();
855
+ if (output .contains (testStorage .getTopicName ())) {
856
+ return true ;
857
+ } else {
858
+ LOGGER .debug ("{} should be in {}, trying again..." , testStorage .getTopicName (), output );
859
+ return false ;
860
+ }
861
+ });
846
862
847
863
String topicDirNameInPod = cmdKubeClient (testStorage .getNamespaceName ()).execInPod (brokerPodName , "/bin/bash" ,
848
864
"-c" , "cd /var/lib/kafka/data/kafka-log0; ls -1 | sed -n '/" + testStorage .getTopicName () + "/p'" ).out ();
@@ -1323,7 +1339,7 @@ void verifyVolumeNamesAndLabels(String namespaceName, String clusterName, String
1323
1339
.forEach (volume -> {
1324
1340
String volumeName = volume .getMetadata ().getName ();
1325
1341
pvcs .add (volumeName );
1326
- LOGGER .info ("Checking labels for volume:" + volumeName );
1342
+ LOGGER .info ("Checking labels for volume: " + volumeName );
1327
1343
assertThat (volume .getMetadata ().getLabels ().get (Labels .STRIMZI_CLUSTER_LABEL ), is (clusterName ));
1328
1344
assertThat (volume .getMetadata ().getLabels ().get (Labels .STRIMZI_KIND_LABEL ), is (Kafka .RESOURCE_KIND ));
1329
1345
assertThat (volume .getMetadata ().getLabels ().get (Labels .STRIMZI_NAME_LABEL ), is (clusterName .concat ("-kafka" )));
0 commit comments