Skip to content

Commit e08aad2

Browse files
committed
Fix another potential race condition in MockReporter
1 parent d08e731 commit e08aad2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

apm-agent-core/src/test/java/co/elastic/apm/agent/MockReporter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,12 @@ public synchronized void decrementReferences() {
340340
*/
341341
public synchronized void assertRecycledAfterDecrementingReferences() {
342342

343+
List<Transaction> transactions = getTransactions();
343344
List<Transaction> transactionsToFlush = transactions.stream()
344345
.filter(t -> !hasEmptyTraceContext(t))
345346
.collect(Collectors.toList());
346347

348+
List<Span> spans = getSpans();
347349
List<Span> spansToFlush = spans.stream()
348350
.filter(s-> !hasEmptyTraceContext(s))
349351
.collect(Collectors.toList());

0 commit comments

Comments
 (0)