Wait for initial traces before starting tests

to ensure a late reported trace doesn’t mess up the test assertions.
This commit is contained in:
Tyler Benson 2018-05-30 11:40:31 +10:00
parent b58a7db7a7
commit 682fb01350
6 changed files with 6 additions and 0 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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