You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2021/02/18 08:33:33 UTC

[GitHub] [james-project] Arsnael commented on a change in pull request #302: WIP: ElasticSearch version 7.2 test adaptation

Arsnael commented on a change in pull request #302:
URL: https://github.com/apache/james-project/pull/302#discussion_r578222512



##########
File path: backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/ElasticSearchIndexerTest.java
##########
@@ -165,22 +143,14 @@ void deleteByQueryShouldWorkOnSingleMessage() {
         RoutingKey routingKey = useDocumentId(documentId);
 
         testee.index(documentId, content, routingKey).block();
-        elasticSearch.awaitForElasticSearch();
-        
+        awaitForElasticSearch(QueryBuilders.matchAllQuery(),1L);

Review comment:
       idem

##########
File path: backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/ElasticSearchIndexerTest.java
##########
@@ -165,22 +143,14 @@ void deleteByQueryShouldWorkOnSingleMessage() {
         RoutingKey routingKey = useDocumentId(documentId);
 
         testee.index(documentId, content, routingKey).block();
-        elasticSearch.awaitForElasticSearch();
-        
+        awaitForElasticSearch(QueryBuilders.matchAllQuery(),1L);
+
         testee.deleteAllMatchingQuery(termQuery("property", "1"), routingKey).block();
-        elasticSearch.awaitForElasticSearch();
-        
-        CALMLY_AWAIT.atMost(Duration.TEN_SECONDS)
-            .until(() -> client.search(
-                    new SearchRequest(INDEX_NAME.getValue())
-                        .source(new SearchSourceBuilder().query(QueryBuilders.matchAllQuery())),
-                    RequestOptions.DEFAULT)
-                .block()
-                .getHits().getTotalHits().value == 0);
+
+        awaitForElasticSearch(QueryBuilders.matchAllQuery(),0L);

Review comment:
       idem

##########
File path: backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/ElasticSearchIndexerTest.java
##########
@@ -104,30 +96,16 @@ void indexMessageShouldThrowWhenJsonIsNull() {
     }
     
     @Test
-    @Disabled("JAMES-3492")
     void updateMessages() {
         String content = "{\"message\": \"trying out Elasticsearch\",\"field\":\"Should be unchanged\"}";
 
         testee.index(DOCUMENT_ID, content, useDocumentId(DOCUMENT_ID)).block();
-        elasticSearch.awaitForElasticSearch();
+        awaitForElasticSearch(QueryBuilders.matchAllQuery(),1L);

Review comment:
       space missing between your arguments

##########
File path: backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/ElasticSearchIndexerTest.java
##########
@@ -196,68 +166,45 @@ void deleteByQueryShouldWorkWhenMultipleMessages() {
         String content3 = "{\"message\": \"trying out Elasticsearch 3\", \"property\":\"2\"}";
         
         testee.index(documentId3, content3, ROUTING).block();
-        elasticSearch.awaitForElasticSearch();
+        awaitForElasticSearch(QueryBuilders.matchAllQuery(),3L);

Review comment:
       idem




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org