Clear TEST_WRITER before waiting to ensure accurate timing

Otherwise the waitForTraces at the end might be triggered prematurely.
This commit is contained in:
Tyler Benson 2018-06-05 14:49:17 +10:00
parent 5fe58dc344
commit 979aa7838f
6 changed files with 6 additions and 0 deletions

View File

@ -39,6 +39,7 @@ class Elasticsearch2NodeClientTest extends AgentTestRunner {
.build()
testNode = NodeBuilder.newInstance().clusterName("test-cluster").settings(settings).build()
testNode.start()
TEST_WRITER.clear()
testNode.client().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(5000)
TEST_WRITER.waitForTraces(1)
}

View File

@ -50,6 +50,7 @@ class Elasticsearch2TransportClientTest extends AgentTestRunner {
.build()
).build()
client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), TCP_PORT))
TEST_WRITER.clear()
client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(5000)
TEST_WRITER.waitForTraces(1)
}

View File

@ -45,6 +45,7 @@ class Elasticsearch5NodeClientTest extends AgentTestRunner {
.build()
testNode = new Node(new Environment(InternalSettingsPreparer.prepareSettings(settings)), [Netty3Plugin])
testNode.start()
TEST_WRITER.clear()
testNode.client().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(5000)
TEST_WRITER.waitForTraces(1)
}

View File

@ -57,6 +57,7 @@ class Elasticsearch5TransportClientTest extends AgentTestRunner {
.build()
)
client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), TCP_PORT))
TEST_WRITER.clear()
client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(5000)
TEST_WRITER.waitForTraces(1)
}

View File

@ -42,6 +42,7 @@ class Elasticsearch6NodeClientTest extends AgentTestRunner {
.build()
testNode = new Node(InternalSettingsPreparer.prepareEnvironment(settings, null), [Netty4Plugin])
testNode.start()
TEST_WRITER.clear()
testNode.client().admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(5000)
TEST_WRITER.waitForTraces(1)
}

View File

@ -54,6 +54,7 @@ class Elasticsearch6TransportClientTest extends AgentTestRunner {
.build()
)
client.addTransportAddress(new TransportAddress(InetAddress.getByName("localhost"), TCP_PORT))
TEST_WRITER.clear()
client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(5000)
TEST_WRITER.waitForTraces(1)
}