Skip to content

Commit d879341

Browse files
bm1549claude
andcommitted
fix: restore acknowledge() before assertTraces to fix timeout
The 3rd consumer span needs acknowledge() to complete before assertTraces(6) can succeed. SCOPE_ITERATION_KEEP_ALIVE alone is not sufficient — the acknowledge triggers the span to finish. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3d43b74 commit d879341

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • dd-java-agent/instrumentation/jms/javax-jms-1.1/src/test/groovy

dd-java-agent/instrumentation/jms/javax-jms-1.1/src/test/groovy/JMS1Test.groovy

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,15 @@ abstract class JMS1Test extends VersionedNamingTestBase {
275275
TextMessage receivedMessage2 = consumer.receive()
276276
receivedMessage2.acknowledge()
277277
TextMessage receivedMessage3 = consumer.receive()
278+
receivedMessage3.acknowledge()
278279

279280
then:
280281
receivedMessage1.text == messageText1
281282
receivedMessage2.text == messageText2
282283
receivedMessage3.text == messageText3
283-
// All 6 traces (3 producer + 3 consumer) are finished because the short
284-
// scope iteration keep-alive ensures the 3rd consumer span is cleaned up promptly.
284+
// All 6 traces (3 producer + 3 consumer) are finished because acknowledge()
285+
// has been called and the short scope iteration keep-alive ensures the 3rd
286+
// consumer span is cleaned up promptly.
285287
assertTraces(6) {
286288
producerTraceWithNaming(it, destination)
287289
producerTraceWithNaming(it, destination)
@@ -292,7 +294,6 @@ abstract class JMS1Test extends VersionedNamingTestBase {
292294
}
293295

294296
cleanup:
295-
receivedMessage3.acknowledge()
296297
producer.close()
297298
consumer.close()
298299
clientSession.close()

0 commit comments

Comments
 (0)