diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4595806ea..12e4343aa 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - java: [8, 11, 17] + java: [8, 11, 17, 23] steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 @@ -54,7 +54,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [8, 11, 17] + java: [8, 11, 17, 23] steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 diff --git a/google-http-client/src/test/java/com/google/api/client/http/javanet/NetHttpTransportTest.java b/google-http-client/src/test/java/com/google/api/client/http/javanet/NetHttpTransportTest.java index 835730793..26ecd5139 100644 --- a/google-http-client/src/test/java/com/google/api/client/http/javanet/NetHttpTransportTest.java +++ b/google-http-client/src/test/java/com/google/api/client/http/javanet/NetHttpTransportTest.java @@ -203,14 +203,17 @@ public void testDisconnectShouldNotWaitToReadResponse() throws IOException { public void handle(HttpExchange httpExchange) throws IOException { byte[] response = httpExchange.getRequestURI().toString().getBytes(); httpExchange.sendResponseHeaders(200, response.length); - - // Sleep for longer than the test timeout - try { - Thread.sleep(100_000); - } catch (InterruptedException e) { - throw new IOException("interrupted", e); - } try (OutputStream out = httpExchange.getResponseBody()) { + byte[] firstByte = new byte[] {0x01}; + out.write(firstByte); + out.flush(); + + // Sleep for longer than the test timeout + try { + Thread.sleep(100_000); + } catch (InterruptedException e) { + throw new IOException("interrupted", e); + } out.write(response); } }