From 45d76e0a7f75d4cab21d4a11dbeda68baa5cf0cd Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Wed, 20 Sep 2017 02:52:36 +0900 Subject: [PATCH] Set es.set.netty.runtime.available.processors to false --- .../stream/alpakka/elasticsearch/ElasticsearchTest.java | 6 +++++- .../stream/alpakka/elasticsearch/ElasticsearchSpec.scala | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/elasticsearch/src/test/java/akka/stream/alpakka/elasticsearch/ElasticsearchTest.java b/elasticsearch/src/test/java/akka/stream/alpakka/elasticsearch/ElasticsearchTest.java index a0616a7f97..5a4ebc24a8 100644 --- a/elasticsearch/src/test/java/akka/stream/alpakka/elasticsearch/ElasticsearchTest.java +++ b/elasticsearch/src/test/java/akka/stream/alpakka/elasticsearch/ElasticsearchTest.java @@ -39,8 +39,12 @@ public static class Book { @BeforeClass public static void setup() throws IOException { + System.setProperty("es.set.netty.runtime.available.processors", "false"); runner = new ElasticsearchClusterRunner(); - runner.build(ElasticsearchClusterRunner.newConfigs().baseHttpPort(9210).baseTransportPort(9310).numOfNode(1)); + runner.build(ElasticsearchClusterRunner.newConfigs() + .baseHttpPort(9210) + .baseTransportPort(9310) + .numOfNode(1)); runner.ensureYellow(); //#init-client diff --git a/elasticsearch/src/test/scala/akka/stream/alpakka/elasticsearch/ElasticsearchSpec.scala b/elasticsearch/src/test/scala/akka/stream/alpakka/elasticsearch/ElasticsearchSpec.scala index aee0055a0f..2a5c78b4f4 100644 --- a/elasticsearch/src/test/scala/akka/stream/alpakka/elasticsearch/ElasticsearchSpec.scala +++ b/elasticsearch/src/test/scala/akka/stream/alpakka/elasticsearch/ElasticsearchSpec.scala @@ -39,7 +39,14 @@ class ElasticsearchSpec extends WordSpec with Matchers with BeforeAndAfterAll { //#define-class override def beforeAll() = { - runner.build(ElasticsearchClusterRunner.newConfigs().baseHttpPort(9200).baseTransportPort(9300).numOfNode(1)) + System.setProperty("es.set.netty.runtime.available.processors", "false") + runner.build( + ElasticsearchClusterRunner + .newConfigs() + .baseHttpPort(9200) + .baseTransportPort(9300) + .numOfNode(1) + ) runner.ensureYellow() register("source", "Akka in Action")