improve logging on before/after shared cluster tests

This commit is contained in:
Shay Banon 2013-09-18 12:35:20 +02:00
parent 6a04c16932
commit db8f2be8bc
1 changed files with 10 additions and 8 deletions

View File

@ -103,11 +103,12 @@ public abstract class AbstractSharedClusterTest extends ElasticsearchTestCase {
cluster.beforeTest(getRandom()); cluster.beforeTest(getRandom());
wipeIndices(); wipeIndices();
wipeTemplates(); wipeTemplates();
logger.info("[{}#{}]: before test", getTestClass().getSimpleName(), getTestName());
} }
@After @After
public void after() throws IOException { public void after() throws IOException {
logger.info("Cleaning up after test."); logger.info("[{}#{}]: cleaning up after test", getTestClass().getSimpleName(), getTestName());
MetaData metaData = client().admin().cluster().prepareState().execute().actionGet().getState().getMetaData(); MetaData metaData = client().admin().cluster().prepareState().execute().actionGet().getState().getMetaData();
assertThat("test leaves persistent cluster metadata behind: " + metaData.persistentSettings().getAsMap(), metaData assertThat("test leaves persistent cluster metadata behind: " + metaData.persistentSettings().getAsMap(), metaData
.persistentSettings().getAsMap().size(), equalTo(0)); .persistentSettings().getAsMap().size(), equalTo(0));
@ -116,6 +117,7 @@ public abstract class AbstractSharedClusterTest extends ElasticsearchTestCase {
wipeIndices(); // wipe after to make sure we fail in the test that didn't ack the delete wipeIndices(); // wipe after to make sure we fail in the test that didn't ack the delete
wipeTemplates(); wipeTemplates();
ensureAllFilesClosed(); ensureAllFilesClosed();
logger.info("[{}#{}]: cleaned up after test", getTestClass().getSimpleName(), getTestName());
} }
public static TestCluster cluster() { public static TestCluster cluster() {