From 793cda09b13e5e6a342144ef7f3da5c4fd5f8b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Mon, 6 May 2019 11:51:35 +0200 Subject: [PATCH] fix smoke test --- elx-http/src/test/java/org/xbib/elx/http/test/SmokeTest.java | 1 + elx-http/src/test/resources/log4j2.xml | 2 +- elx-node/src/test/java/org/xbib/elx/node/test/SmokeTest.java | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/elx-http/src/test/java/org/xbib/elx/http/test/SmokeTest.java b/elx-http/src/test/java/org/xbib/elx/http/test/SmokeTest.java index bfc8021..4670c6f 100644 --- a/elx-http/src/test/java/org/xbib/elx/http/test/SmokeTest.java +++ b/elx-http/src/test/java/org/xbib/elx/http/test/SmokeTest.java @@ -54,6 +54,7 @@ class SmokeTest { client.newIndex(indexDefinition); client.index(indexDefinition.getFullIndexName(), "1", true, "{ \"name\" : \"Hello World\"}"); client.flush(); + client.waitForResponses(30, TimeUnit.SECONDS); client.updateReplicaLevel(indexDefinition, 2); int replica = client.getReplicaLevel(indexDefinition); assertEquals(2, replica); diff --git a/elx-http/src/test/resources/log4j2.xml b/elx-http/src/test/resources/log4j2.xml index 1258d7f..6c323f8 100644 --- a/elx-http/src/test/resources/log4j2.xml +++ b/elx-http/src/test/resources/log4j2.xml @@ -6,7 +6,7 @@ - + diff --git a/elx-node/src/test/java/org/xbib/elx/node/test/SmokeTest.java b/elx-node/src/test/java/org/xbib/elx/node/test/SmokeTest.java index 80767cb..3435df9 100644 --- a/elx-node/src/test/java/org/xbib/elx/node/test/SmokeTest.java +++ b/elx-node/src/test/java/org/xbib/elx/node/test/SmokeTest.java @@ -36,6 +36,9 @@ class SmokeTest { assertEquals(helper.getClusterName(), client.getClusterName()); client.newIndex("test"); client.index("test", "1", true, "{ \"name\" : \"Hello World\"}"); // single doc ingest + client.flush(); + client.waitForResponses(30, TimeUnit.SECONDS); + client.checkMapping("test"); client.update("test", "1", "{ \"name\" : \"Another name\"}"); client.delete("test", "1"); client.flush(); @@ -43,13 +46,11 @@ class SmokeTest { client.waitForRecovery("test", 10L, TimeUnit.SECONDS); client.delete("test", "1"); client.flush(); - client.checkMapping("test"); client.deleteIndex("test"); IndexDefinition indexDefinition = client.buildIndexDefinitionFromSettings("test", Settings.builder() .build()); assertEquals(0, indexDefinition.getReplicaLevel()); client.newIndex(indexDefinition); - client.waitForRecovery(indexDefinition.getFullIndexName(), 30L, TimeUnit.SECONDS); client.index(indexDefinition.getFullIndexName(), "1", true, "{ \"name\" : \"Hello World\"}"); client.flush(); client.waitForResponses(30, TimeUnit.SECONDS);