Improve test reliability
MODIFY
dd-java-agent/instrumentation/jms/src/latestDepTest/groovy/SpringListenerJMS2Test.groovy
dd-java-agent/instrumentation/jms/src/latestDepTest/groovy/SpringListenerJMS2Test.groovy
@@ -36,6 +36,14 @@ class SpringListenerJMS2Test extends AgentTestRunner {
def template = new JmsTemplate(factory)
template.convertAndSend("someSpringQueue", "a message")
+ TEST_WRITER.waitForTraces(3)
+ // Manually reorder if reported in the wrong order.
+ if (TEST_WRITER[1][0].operationName == "jms.produce") {
+ def producerTrace = TEST_WRITER[1]
+ TEST_WRITER[1] = TEST_WRITER[0]
+ TEST_WRITER[0] = producerTrace
+ }
+
expect:
assertTraces(3) {
producerTrace(it, 0, "Queue someSpringQueue")

MODIFY
dd-java-agent/instrumentation/jms/src/test/groovy/SpringListenerJMS1Test.groovy
dd-java-agent/instrumentation/jms/src/test/groovy/SpringListenerJMS1Test.groovy
@@ -37,6 +37,14 @@ class SpringListenerJMS1Test extends AgentTestRunner {
def template = new JmsTemplate(factory)
template.convertAndSend("someSpringQueue", "a message")
+ TEST_WRITER.waitForTraces(3)
+ // Manually reorder if reported in the wrong order.
+ if (TEST_WRITER[1][0].operationName == "jms.produce") {
+ def producerTrace = TEST_WRITER[1]
+ TEST_WRITER[1] = TEST_WRITER[0]
+ TEST_WRITER[0] = producerTrace
+ }
+
expect:
assertTraces(3) {
producerTrace(it, 0, "Queue someSpringQueue")

Improve test reliability