Skip to content

Fix flaky test on TomcatServlet3TestAsync #7550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ abstract class TomcatServlet3Test extends AbstractServlet3Test<Tomcat, Context>

and:
assertTraces(count) {
Set<Tuple2<String, String>> loggedSpanIds = accessLogValue.loggedIds.toSet()
assert loggedSpanIds.size() == count
(1..count).eachWithIndex { val, i ->
trace(spanCount(SUCCESS)) {
sortSpansByStart()
Expand All @@ -212,9 +214,8 @@ abstract class TomcatServlet3Test extends AbstractServlet3Test<Tomcat, Context>
}
}

def (String traceId, String spanId) = accessLogValue.loggedIds[i]
assert trace(i).get(0).traceId.toString() == traceId
assert trace(i).get(0).spanId.toString() == spanId
def ids = new Tuple2(trace(i).get(0).localRootSpan.traceId.toString(), trace(i).get(0).localRootSpan.spanId.toString())
assert ids in loggedSpanIds
}
}

Expand Down Expand Up @@ -250,8 +251,8 @@ abstract class TomcatServlet3Test extends AbstractServlet3Test<Tomcat, Context>
}

def (String traceId, String spanId) = accessLogValue.loggedIds[0]
assert trace(0).get(0).traceId.toString() == traceId
assert trace(0).get(0).spanId.toString() == spanId
assert trace(0).get(0).localRootSpan.traceId.toString() == traceId
assert trace(0).get(0).localRootSpan.spanId.toString() == spanId
}

where:
Expand Down