diff --git a/gradle.properties b/gradle.properties index 95c7fe8..a739c74 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ group = org.xbib name = elasticsearch-extras-client -version = 5.3.0.0 +version = 5.3.0.1 elasticsearch-client-transport.version = 5.3.0 xbib-metrics.version = 1.0.0 diff --git a/src/integration-test/java/org/xbib/elasticsearch/extras/client/node/BulkNodeDuplicateIDTest.java b/src/integration-test/java/org/xbib/elasticsearch/extras/client/node/BulkNodeDuplicateIDTest.java index cb32cac..95f3ca8 100644 --- a/src/integration-test/java/org/xbib/elasticsearch/extras/client/node/BulkNodeDuplicateIDTest.java +++ b/src/integration-test/java/org/xbib/elasticsearch/extras/client/node/BulkNodeDuplicateIDTest.java @@ -24,14 +24,15 @@ public class BulkNodeDuplicateIDTest extends NodeTestBase { private static final Logger logger = LogManager.getLogger(BulkNodeDuplicateIDTest.class.getName()); - private static final Long MAX_ACTIONS = 1000L; + private static final long MAX_ACTIONS = 100L; - private static final Long NUM_ACTIONS = 12345L; + private static final long NUM_ACTIONS = 12345L; @Test public void testDuplicateDocIDs() throws Exception { - long numactions = NUM_ACTIONS; + final BulkNodeClient client = ClientBuilder.builder() + .put(ClientBuilder.MAX_CONCURRENT_REQUESTS, 2) // avoid EsRejectedExecutionException .put(ClientBuilder.MAX_ACTIONS_PER_REQUEST, MAX_ACTIONS) .setMetric(new SimpleBulkMetric()) .setControl(new SimpleBulkControl()) @@ -55,11 +56,16 @@ public class BulkNodeDuplicateIDTest extends NodeTestBase { logger.warn("skipping, no node available"); } finally { client.shutdown(); - assertEquals(numactions, client.getMetric().getSucceeded().getCount()); if (client.hasThrowable()) { logger.error("error", client.getThrowable()); } assertFalse(client.hasThrowable()); + logger.info("numactions = {}, submitted = {}, succeeded= {}, failed = {}", NUM_ACTIONS, + client.getMetric().getSubmitted().getCount(), + client.getMetric().getSucceeded().getCount(), + client.getMetric().getFailed().getCount()); + assertEquals(NUM_ACTIONS, client.getMetric().getSubmitted().getCount()); + assertEquals(NUM_ACTIONS, client.getMetric().getSucceeded().getCount()); } } } diff --git a/src/integration-test/java/org/xbib/elasticsearch/extras/client/transport/BulkTransportDuplicateIDTest.java b/src/integration-test/java/org/xbib/elasticsearch/extras/client/transport/BulkTransportDuplicateIDTest.java index 148215a..9783dc2 100644 --- a/src/integration-test/java/org/xbib/elasticsearch/extras/client/transport/BulkTransportDuplicateIDTest.java +++ b/src/integration-test/java/org/xbib/elasticsearch/extras/client/transport/BulkTransportDuplicateIDTest.java @@ -24,15 +24,15 @@ public class BulkTransportDuplicateIDTest extends NodeTestBase { private static final Logger logger = LogManager.getLogger(BulkTransportDuplicateIDTest.class.getName()); - private static final Long MAX_ACTIONS = 1000L; + private static final long MAX_ACTIONS = 100L; - private static final Long NUM_ACTIONS = 12345L; + private static final long NUM_ACTIONS = 12345L; @Test public void testDuplicateDocIDs() throws Exception { - long numactions = NUM_ACTIONS; final BulkTransportClient client = ClientBuilder.builder() .put(getClientSettings()) + .put(ClientBuilder.MAX_CONCURRENT_REQUESTS, 2) // avoid EsRejectedExecutionException .put(ClientBuilder.MAX_ACTIONS_PER_REQUEST, MAX_ACTIONS) .setMetric(new SimpleBulkMetric()) .setControl(new SimpleBulkControl()) @@ -56,11 +56,16 @@ public class BulkTransportDuplicateIDTest extends NodeTestBase { logger.warn("skipping, no node available"); } finally { client.shutdown(); - assertEquals(numactions, client.getMetric().getSucceeded().getCount()); if (client.hasThrowable()) { logger.error("error", client.getThrowable()); } assertFalse(client.hasThrowable()); + logger.info("numactions = {}, submitted = {}, succeeded= {}, failed = {}", NUM_ACTIONS, + client.getMetric().getSubmitted().getCount(), + client.getMetric().getSucceeded().getCount(), + client.getMetric().getFailed().getCount()); + assertEquals(NUM_ACTIONS, client.getMetric().getSubmitted().getCount()); + assertEquals(NUM_ACTIONS, client.getMetric().getSucceeded().getCount()); } } }