Skip to content
Open
Show file tree
Hide file tree
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 @@ -1234,7 +1234,6 @@ abstract class HttpServerTest<SERVER> extends WithHttpServer<SERVER> {
}
}

@Flaky(value = "https://github.com/DataDog/dd-trace-java/issues/9396", suites = ["PekkoHttpServerInstrumentationAsyncHttp2Test"])
def "test exception"() {
setup:
def method = "GET"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,13 @@ object PekkoHttpTestWebServer {
): HttpRequest => Future[HttpResponse] = { request =>
Future {
syncHandler(request)
}.recover { case e: Exception =>
// Recover from exceptions to return a proper HTTP response instead of a
// failed Future. When the Future fails, the span completion depends on
// async continuation cleanup which can race with the test's trace assertion,
// causing flaky timeouts waiting for the trace to be written.
HttpResponse(status = EXCEPTION.getStatus, entity = e.getMessage)
.withDefaultHeaders(defaultHeader)
}
}

Expand Down
Loading