Skip to content

Commit

Permalink
karatelabs#2432 fix remaining feature count displaying as 0 for singl…
Browse files Browse the repository at this point in the history
…e thread runs
  • Loading branch information
dvargas46 committed Feb 21, 2024
1 parent b8804cf commit 523902f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion karate-core/src/main/java/com/intuit/karate/Suite.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ public void run() {
}
hooks.forEach(h -> h.beforeSuite(this));
int index = 0;
List<FeatureRuntime> featureRuntimes = new ArrayList<>(featuresFound);
for (FeatureCall feature : features) {
final int featureNum = ++index;
FeatureRuntime fr = FeatureRuntime.of(this, feature);
Expand All @@ -233,11 +234,12 @@ public void run() {
onFeatureDone(fr.result, featureNum);
future.complete(Boolean.TRUE);
});
pendingTasks.submit(fr);
featureRuntimes.add(fr);
}
if (featuresFound > 1) {
logger.debug("waiting for {} features to complete", featuresFound);
}
featureRuntimes.forEach(pendingTasks::submit);
CompletableFuture[] futuresArray = futures.toArray(new CompletableFuture[futures.size()]);
if (timeoutMinutes > 0) {
CompletableFuture.allOf(futuresArray).get(timeoutMinutes, TimeUnit.MINUTES);
Expand Down

0 comments on commit 523902f

Please sign in to comment.