|
58 | 58 | import com.linecorp.armeria.client.WebClient; |
59 | 59 | import com.linecorp.armeria.client.brave.BraveClient; |
60 | 60 | import com.linecorp.armeria.client.thrift.ThriftClients; |
| 61 | +import com.linecorp.armeria.common.AggregatedHttpResponse; |
61 | 62 | import com.linecorp.armeria.common.HttpRequest; |
62 | 63 | import com.linecorp.armeria.common.HttpResponse; |
63 | 64 | import com.linecorp.armeria.common.HttpStatus; |
@@ -137,7 +138,7 @@ protected void configure(ServerBuilder sb) throws Exception { |
137 | 138 | protected HttpResponse doGet(ServiceRequestContext ctx, HttpRequest req) |
138 | 139 | throws Exception { |
139 | 140 | final ListeningExecutorService executorService = MoreExecutors.listeningDecorator( |
140 | | - Executors.newFixedThreadPool(2)); |
| 141 | + ctx.makeContextAware(Executors.newFixedThreadPool(2))); |
141 | 142 | final CountDownLatch countDownLatch = new CountDownLatch(2); |
142 | 143 |
|
143 | 144 | final ListenableFuture<List<Object>> spanAware = allAsList(IntStream.range(1, 3).mapToObj( |
@@ -444,7 +445,8 @@ void testServiceInitiatedTrace(String type) throws Exception { |
444 | 445 |
|
445 | 446 | @Test |
446 | 447 | void testSpanInThreadPoolHasSameTraceId() throws Exception { |
447 | | - server.webClient().get("pool").aggregate().get(); |
| 448 | + final AggregatedHttpResponse res = server.blockingWebClient().get("pool"); |
| 449 | + assertThat(res.contentUtf8()).isEqualTo("Lee"); |
448 | 450 | await().untilAsserted(() -> assertThat(spanHandler.spans).hasSize(5)); |
449 | 451 | final MutableSpan[] spans = spanHandler.take(5); |
450 | 452 | assertThat(Arrays.stream(spans).map(MutableSpan::traceId).collect(toImmutableSet())).hasSize(1); |
|
0 commit comments