From: Simon Brandhof Date: Sat, 29 Nov 2014 09:54:29 +0000 (+0100) Subject: CI error investigations - add logs to ServerTester X-Git-Tag: 5.0-RC1~151 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8b8d781cf04e0ac85aa8b851c56d46ca372a386f;p=sonarqube.git CI error investigations - add logs to ServerTester --- diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/BackendCleanup.java b/server/sonar-server/src/main/java/org/sonar/server/platform/BackendCleanup.java index 0e3b8c66aa1..285b8113eec 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/BackendCleanup.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/BackendCleanup.java @@ -21,6 +21,7 @@ package org.sonar.server.platform; import org.apache.commons.dbutils.DbUtils; import org.elasticsearch.index.query.QueryBuilders; +import org.slf4j.LoggerFactory; import org.sonar.api.ServerComponent; import org.sonar.core.persistence.DatabaseVersion; import org.sonar.core.persistence.DbSession; @@ -77,6 +78,7 @@ public class BackendCleanup implements ServerComponent { } public void clearIndexes() { + LoggerFactory.getLogger(getClass()).info("Truncate Elasticsearch indices"); searchClient.prepareDeleteByQuery(searchClient.prepareState().get() .getState().getMetaData().concreteAllIndices()) .setQuery(QueryBuilders.matchAllQuery()) diff --git a/server/sonar-server/src/test/java/org/sonar/server/tester/ServerTester.java b/server/sonar-server/src/test/java/org/sonar/server/tester/ServerTester.java index b9c3ae77f98..c8552358fd1 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/tester/ServerTester.java +++ b/server/sonar-server/src/test/java/org/sonar/server/tester/ServerTester.java @@ -110,9 +110,11 @@ public class ServerTester extends ExternalResource { } try { + LOG.info("Starting elasticsearch server"); searchServer.start(); // wait for ES to be ready searchServer.isReady(); + LOG.info("Elasticsearch server started"); platform.init(properties); platform.addComponents(components); @@ -162,7 +164,9 @@ public class ServerTester extends ExternalResource { platform = null; try { if (searchServer != null) { + LOG.info("Stopping Elasticsearch server"); searchServer.stop(); + LOG.info("Elasticsearch server stopped"); } } catch (Exception e) { LOG.error("Fail to stop elasticsearch server", e);