From 86bfa6ecdcf7abb9e0f605d6c82298b086b0717b Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Thu, 27 Feb 2014 22:39:39 +0100 Subject: [PATCH] Improve error reporting on breaker stats assertion --- .../test/ElasticsearchIntegrationTest.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/test/java/org/elasticsearch/test/ElasticsearchIntegrationTest.java b/src/test/java/org/elasticsearch/test/ElasticsearchIntegrationTest.java index 147619ae4ad..d453e20390a 100644 --- a/src/test/java/org/elasticsearch/test/ElasticsearchIntegrationTest.java +++ b/src/test/java/org/elasticsearch/test/ElasticsearchIntegrationTest.java @@ -251,11 +251,14 @@ public abstract class ElasticsearchIntegrationTest extends ElasticsearchTestCase .transientSettings().getAsMap().size(), equalTo(0)); } - ensureEstimatedStats(); - wipeIndices("_all"); // wipe after to make sure we fail in the test that - // didn't ack the delete - wipeTemplates(); - wipeRepositories(); + try { + ensureEstimatedStats(); + } finally { + wipeIndices("_all"); // wipe after to make sure we fail in the test that + // didn't ack the delete + wipeTemplates(); + wipeRepositories(); + } ensureAllSearchersClosed(); ensureAllFilesClosed(); logger.info("[{}#{}]: cleaned up after test", getTestClass().getSimpleName(), getTestName()); @@ -350,7 +353,8 @@ public abstract class ElasticsearchIntegrationTest extends ElasticsearchTestCase NodesStatsResponse nodeStats = client().admin().cluster().prepareNodesStats() .clear().setBreaker(true).execute().actionGet(); for (NodeStats stats : nodeStats.getNodes()) { - assertThat("Breaker reset to 0 ", stats.getBreaker().getEstimated(), equalTo(0L)); + assertThat("Breaker reset to 0 - cleared on [" + all.getSuccessfulShards() + "] shards total [" + all.getTotalShards() + "]", + stats.getBreaker().getEstimated(), equalTo(0L)); } } }