@Test
    void sendHelloViaHttp1WithConnectionClose() throws Exception {
        sendConnectionClose.set(true);

        final AtomicReference<SessionProtocol> sessionProtocol = new AtomicReference<>();
        final HelloService.Iface client = newSchemeCapturingClient(http1uri(HTTP), sessionProtocol);

        for (int i = 0; i <= MAX_RETRIES; i++) {
            try {
                assertThat(client.hello("ancient world")).isEqualTo("Hello, ancient world!");
                assertThat(sessionProtocol.get()).isEqualTo(H1C);
                if (i != 0) {
                    logger.warn("Succeeded after {} retries.", i);
                }
                break;
            } catch (ClosedSessionException e) {
                // Flaky test; try again.
                // FIXME(trustin): Fix flakiness.
                if (i == MAX_RETRIES) {
                    throw e;
                }
            }
        }
    }
When an upgrade request is rejected with 'Connection: close', the client should retry the connection
attempt silently with explicit H1C.
thrift/thrift0.13/src/test/java/com/linecorp/armeria/client/thrift/ThriftOverHttpClientTServletIntegrationTest.java