Make Akka client test more stable

We already have a hack to wait for client span to close after the
request because it is closed on separate thread. This patch extends
that hack to handle cases when original request throws an exception.
This commit is contained in:
Nikolay Martynov 2019-06-13 11:51:10 -04:00
parent fc30badbee
commit f5f3386f79
1 changed files with 6 additions and 2 deletions

View File

@ -23,8 +23,12 @@ class AkkaHttpClientInstrumentationTest extends HttpClientTest<AkkaHttpClientDec
.withMethod(HttpMethods.lookup(method).get())
.addHeaders(headers.collect { RawHeader.create(it.key, it.value) })
def response = Http.get(system).singleRequest(request, materializer).toCompletableFuture().get()
def response
try {
response = Http.get(system).singleRequest(request, materializer).toCompletableFuture().get()
} finally {
blockUntilChildSpansFinished(1)
}
callback?.call()
return response.status().intValue()
}