]> source.dussan.org Git - sonarqube.git/commitdiff
CI error investigations - add logs to ServerTester
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Sat, 29 Nov 2014 09:54:29 +0000 (10:54 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Sat, 29 Nov 2014 09:54:29 +0000 (10:54 +0100)
server/sonar-server/src/main/java/org/sonar/server/platform/BackendCleanup.java
server/sonar-server/src/test/java/org/sonar/server/tester/ServerTester.java

index 0e3b8c66aa107dbdfe6fd744f591b7dcd8dd7d68..285b8113eec9943459e7a1c24e588c2ac4632545 100644 (file)
@@ -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())
index b9c3ae77f98da762813567362ddcd311c69b5c8f..c8552358fd1dffecf02851a373b4d5d305709113 100644 (file)
@@ -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);