@Test
    void testFaultyDelegate() throws Exception {
        final ClientRequestContext ctx = newContext();
        final HttpRequest req = newReq();

        when(delegate.execute(ctx, req)).thenThrow(Exception.class);

        final ConcurrencyLimitingClient client = newDecorator(1).apply(delegate);
        assertThat(client.numActiveRequests()).isZero();

        final HttpResponse res = client.execute(ctx, req);

        // Consume everything from the returned response so its close future is completed.
        res.subscribe(NoopSubscriber.get());

        await().untilAsserted(() -> assertThat(res.isOpen()).isFalse());
        assertThatThrownBy(() -> res.whenComplete().get()).hasCauseInstanceOf(Exception.class);
        await().untilAsserted(() -> assertThat(client.numActiveRequests()).isZero());
    }
Tests the case where a delegate raises an exception rather than returning a response.
core/src/test/java/com/linecorp/armeria/client/limit/ConcurrencyLimitingClientTest.java