Skip to content

Commit ef192ff

Browse files
committed
ESIntegTestCase.jav: use ClusterState.prettyPrint for pending ClusterState assertions
1 parent f81d28d commit ef192ff

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164
import java.util.concurrent.atomic.AtomicLong;
165165
import java.util.function.BooleanSupplier;
166166
import java.util.function.Function;
167+
import java.util.stream.Collectors;
167168

168169
import static org.elasticsearch.client.Requests.syncedFlushRequest;
169170
import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_REPLICAS;
@@ -535,13 +536,10 @@ protected final void afterInternal(boolean afterClass) throws Exception {
535536
for (Discovery discovery : internalCluster().getInstances(Discovery.class)) {
536537
if (discovery instanceof ZenDiscovery) {
537538
final ZenDiscovery zenDiscovery = (ZenDiscovery) discovery;
538-
assertBusy(new Runnable() {
539-
@Override
540-
public void run() {
541-
assertThat("still having pending states: " + Strings.arrayToDelimitedString(zenDiscovery.pendingClusterStates(), "\n"),
542-
zenDiscovery.pendingClusterStates(), emptyArray());
543-
}
544-
});
539+
assertBusy(() -> assertThat(zenDiscovery.localNode().getName() + " still having pending states: \n" +
540+
Arrays.stream(zenDiscovery.pendingClusterStates()).map(ClusterState::prettyPrint)
541+
.collect(Collectors.joining("\n")),
542+
zenDiscovery.pendingClusterStates(), emptyArray()));
545543
}
546544
}
547545
}

0 commit comments

Comments
 (0)