Skip to content

Commit

Permalink
validate the response
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhee17 committed Feb 21, 2025
1 parent c53cb0a commit 73dca92
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import com.linecorp.armeria.client.WebClient;
import com.linecorp.armeria.client.brave.BraveClient;
import com.linecorp.armeria.client.thrift.ThriftClients;
import com.linecorp.armeria.common.AggregatedHttpResponse;
import com.linecorp.armeria.common.HttpRequest;
import com.linecorp.armeria.common.HttpResponse;
import com.linecorp.armeria.common.HttpStatus;
Expand Down Expand Up @@ -137,7 +138,7 @@ protected void configure(ServerBuilder sb) throws Exception {
protected HttpResponse doGet(ServiceRequestContext ctx, HttpRequest req)
throws Exception {
final ListeningExecutorService executorService = MoreExecutors.listeningDecorator(
Executors.newFixedThreadPool(2));
ctx.makeContextAware(Executors.newFixedThreadPool(2)));
final CountDownLatch countDownLatch = new CountDownLatch(2);

final ListenableFuture<List<Object>> spanAware = allAsList(IntStream.range(1, 3).mapToObj(
Expand Down Expand Up @@ -444,7 +445,8 @@ void testServiceInitiatedTrace(String type) throws Exception {

@Test
void testSpanInThreadPoolHasSameTraceId() throws Exception {
server.webClient().get("pool").aggregate().get();
final AggregatedHttpResponse res = server.blockingWebClient().get("pool");
assertThat(res.contentUtf8()).isEqualTo("Lee");
await().untilAsserted(() -> assertThat(spanHandler.spans).hasSize(5));
final MutableSpan[] spans = spanHandler.take(5);
assertThat(Arrays.stream(spans).map(MutableSpan::traceId).collect(toImmutableSet())).hasSize(1);
Expand Down

0 comments on commit 73dca92

Please sign in to comment.