Skip to content

Commit e2c988e

Browse files
committed
disable testDisconnectShouldNotWaitToReadResponse for JDK >= 23
1 parent dceff5b commit e2c988e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

google-http-client/src/test/java/com/google/api/client/http/javanet/NetHttpTransportTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
package com.google.api.client.http.javanet;
1616

17+
import static org.junit.Assume.assumeThat;
18+
1719
import com.google.api.client.http.GenericUrl;
1820
import com.google.api.client.http.HttpTransport;
1921
import com.google.api.client.testing.http.HttpTesting;
@@ -31,9 +33,12 @@
3133
import java.net.InetSocketAddress;
3234
import java.net.URL;
3335
import java.security.KeyStore;
36+
import java.util.Arrays;
3437
import java.util.concurrent.ExecutorService;
3538
import java.util.concurrent.Executors;
3639
import junit.framework.TestCase;
40+
import org.hamcrest.CoreMatchers;
41+
import org.hamcrest.core.Is;
3742
import org.junit.Test;
3843

3944
/**
@@ -195,6 +200,10 @@ public void close() {
195200

196201
@Test(timeout = 10_000L)
197202
public void testDisconnectShouldNotWaitToReadResponse() throws IOException {
203+
// This test does not behave as expected since JDK 23
204+
// see https://bugs.openjdk.org/browse/JDK-6968351
205+
int javaVersion = Integer.parseInt(System.getProperty("java.version").split("\\.")[0]);
206+
assumeThat(javaVersion < 23, CoreMatchers.is(true));
198207
// This handler waits for 100s before returning writing content. The test should
199208
// timeout if disconnect waits for the response before closing the connection.
200209
final HttpHandler handler =

0 commit comments

Comments
 (0)