File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/test/java/io/managed/services/test/cluster Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -409,6 +409,22 @@ public void testReportedCapacityMatchesNumberOfExistingInstances(ManagedKafkaTyp
409409 log .debug ("newly observed remaining capacity '{}'" , newlyObservedRemainingCapacity );
410410 if (newlyObservedRemainingCapacity > remainingCapacityBefore )
411411 return true ;
412+
413+ // see if any new instance of given type was created, if so don't expect capacity to be increased
414+ List <String > currentKafkaInstances = FleetshardUtils .listManagedKafka (oc , mkType ).stream ()
415+ .map (e -> e .getMetadata ().getName ())
416+ .collect (Collectors .toList ());
417+ // filter: keep instances that did not existed previously, and filter instance that we created
418+ List <String > instancesCreatedDuringFreeingCapacity = currentKafkaInstances .stream ()
419+ .filter (e -> !kafkaInstanceNamesBeforeCreating .contains (e ))
420+ .collect (Collectors .toList ());
421+ log .debug ("count of instances that have been created since begging of waiting for freeing capacity {}" , instancesCreatedDuringFreeingCapacity .size ());
422+ log .debug (instancesCreatedDuringFreeingCapacity );
423+
424+ if (instancesCreatedDuringFreeingCapacity .size () > 1 )
425+ throw new SkipException ("Instances created during waiting for freeing capacity, no longer possible to observe freeing capacity" );
426+
427+ // continue waiting
412428 return false ;
413429 });
414430
You can’t perform that action at this time.
0 commit comments