Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,10 @@ abstract class JMS1Test extends VersionedNamingTestBase {
receivedMessage1.text == messageText1
receivedMessage2.text == messageText2
receivedMessage3.text == messageText3
// only two consume traces will be finished at this point
assertTraces(5) {
// At least two consume traces will be finished at this point (3 producer + 2 consumer = 5).
// The 3rd consumer trace may also be finished early due to the scope iteration keep-alive
// cleanup firing before acknowledge() is called, so we tolerate 5 or 6 traces here.
assertTraces(5, true) {
producerTraceWithNaming(it, destination)
producerTraceWithNaming(it, destination)
producerTraceWithNaming(it, destination)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ class ListWriterAssert {
try {
writer.waitForTraces(expectedSize)
def array = writer.toArray()
assert array.length == expectedSize
if (ignoreAdditionalTraces) {
assert array.length >= expectedSize
} else {
assert array.length == expectedSize
}
def traces = (Arrays.asList(array) as List<List<DDSpan>>)
Collections.sort(traces, traceSorter)
def asserter = new ListWriterAssert(traces)
Expand Down
Loading