From 8b8d781cf04e0ac85aa8b851c56d46ca372a386f Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Sat, 29 Nov 2014 10:54:29 +0100 Subject: [PATCH] CI error investigations - add logs to ServerTester --- .../main/java/org/sonar/server/platform/BackendCleanup.java | 2 ++ .../src/test/java/org/sonar/server/tester/ServerTester.java | 4 ++++ 2 files changed, 6 insertions(+) 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); -- 2.39.5