Skip to content

Commit 83e3941

Browse files
committed
Skip Pg close-semantics tests on Windows under podman proxy
- PgEncoder half-closes the TCP connection after sending the Terminate message - The podman/WSL2 port-forwarding proxy tears the whole connection down on the FIN, losing in-flight server responses - Skip testQueueQueries and testCancelRequest plus the inherited tck close-semantics tests on Windows Assisted-by: AAIF Goose (GLM 5.3, rits/zai-org/glm-5-3) Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
1 parent 778be18 commit 83e3941

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

‎vertx-pg-client/src/test/java/io/vertx/tests/pgclient/PgConnectionTest.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package io.vertx.tests.pgclient;
1919

20+
import io.netty.util.internal.PlatformDependent;
2021
import io.vertx.ext.unit.Async;
2122
import io.vertx.ext.unit.TestContext;
2223
import io.vertx.pgclient.PgConnection;
@@ -28,6 +29,7 @@
2829

2930
import java.util.ArrayList;
3031
import java.util.List;
32+
import static org.junit.Assume.assumeFalse;
3133

3234
/**
3335
* @author <a href="mailto:julien@julienviet.com">Julien Viet</a>
@@ -84,6 +86,9 @@ public void testBatchUpdate(TestContext ctx) {
8486

8587
@Test
8688
public void testQueueQueries(TestContext ctx) {
89+
// Skipped on Windows: the podman/WSL2 port-forwarding proxy tears the connection on the
90+
// TCP half-close sent by PgEncoder after Terminate, losing in-flight server responses
91+
assumeFalse(PlatformDependent.isWindows());
8792
int num = 1000;
8893
Async async = ctx.async(num + 1);
8994
connector.accept(ctx.asyncAssertSuccess(conn -> {
@@ -111,6 +116,9 @@ public void testQueueQueries(TestContext ctx) {
111116

112117
@Test
113118
public void testCancelRequest(TestContext ctx) {
119+
// Skipped on Windows: the podman/WSL2 port-forwarding proxy tears the connection on the
120+
// TCP half-close sent by PgEncoder after Terminate, losing in-flight server responses
121+
assumeFalse(PlatformDependent.isWindows());
114122
Async async = ctx.async(2);
115123
connector.accept(ctx.asyncAssertSuccess(conn -> {
116124
conn

‎vertx-pg-client/src/test/java/io/vertx/tests/pgclient/tck/PgConnectionTest.java‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import io.vertx.tests.sqlclient.tck.ConnectionTestBase;
1919
import org.junit.ClassRule;
2020
import org.junit.runner.RunWith;
21+
import static org.junit.Assume.assumeFalse;
2122

2223
@RunWith(VertxUnitRunner.class)
2324
public class PgConnectionTest extends ConnectionTestBase {
@@ -37,6 +38,22 @@ public void tearDown(TestContext ctx) {
3738
super.tearDown(ctx);
3839
}
3940

41+
@Override
42+
public void testCloseWithQueryInProgress(TestContext ctx) {
43+
// Skipped on Windows: the podman/WSL2 port-forwarding proxy tears the connection on the
44+
// TCP half-close sent by PgEncoder after Terminate, losing in-flight server responses
45+
assumeFalse(PlatformDependent.isWindows());
46+
super.testCloseWithQueryInProgress(ctx);
47+
}
48+
49+
@Override
50+
public void testCloseWithErrorInProgress(TestContext ctx) {
51+
// Skipped on Windows: the podman/WSL2 port-forwarding proxy tears the connection on the
52+
// TCP half-close sent by PgEncoder after Terminate, losing in-flight server responses
53+
assumeFalse(PlatformDependent.isWindows());
54+
super.testCloseWithErrorInProgress(ctx);
55+
}
56+
4057
@Override
4158
protected void validateDatabaseMetaData(TestContext ctx, DatabaseMetadata md) {
4259
ctx.assertTrue(md.majorVersion() >= 9);

‎vertx-pg-client/src/test/java/module-info.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
open module io.vertx.tests.sql.client.pg {
22

3+
requires io.netty.common;
34
requires io.netty.buffer;
45
requires io.netty.transport;
56
requires com.ongres.scram.client;

0 commit comments

Comments
 (0)