]> source.dussan.org Git - sonarqube.git/commitdiff
Testing fix, ignore please lj/travis-fix-for-master 3293/head
authorLukasz Jarocki <lukasz.jarocki@sonarsource.com>
Thu, 31 Mar 2022 14:53:03 +0000 (16:53 +0200)
committerLukasz Jarocki <lukasz.jarocki@sonarsource.com>
Thu, 31 Mar 2022 14:53:03 +0000 (16:53 +0200)
server/sonar-server-common/src/testFixtures/java/org/sonar/server/es/EsTester.java

index 5ce592554f695df9874399efd3f40ff28e3d4268..cf41995134811dff104390b446d1c37b33419398 100644 (file)
@@ -45,6 +45,7 @@ import org.apache.http.HttpHost;
 import org.elasticsearch.ElasticsearchStatusException;
 import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest;
 import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
+import org.elasticsearch.action.admin.indices.flush.FlushRequest;
 import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
 import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest;
 import org.elasticsearch.action.bulk.BulkRequest;
@@ -181,6 +182,11 @@ public class EsTester extends ExternalResource {
     }
 
     deleteAllDocumentsInIndexes();
+    try {
+      ES_REST_CLIENT.nativeClient().indices().flush(new FlushRequest(ALL_INDICES.getName()), RequestOptions.DEFAULT);
+    } catch (IOException e) {
+      e.printStackTrace();
+    }
   }
 
   private void deleteAllDocumentsInIndexes() {