From f38137b0d7b76644793636277f3e38b4fa6dc557 Mon Sep 17 00:00:00 2001 From: Thomas Segismont Date: Tue, 1 Dec 2026 18:47:32 +0100 Subject: [PATCH 1/5] Skip some MySQL tests on Windows - Skip LOCAL INFILE tests in MySQLQueryTest - Guard mysqld socket directory creation and bind mount in MySQLRule Signed-off-by: Thomas Segismont --- .../vertx/tests/mysqlclient/MySQLQueryTest.java | 9 +++++++++ .../vertx/tests/mysqlclient/junit/MySQLRule.java | 16 +++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/vertx-mysql-client/src/test/java/io/vertx/tests/mysqlclient/MySQLQueryTest.java b/vertx-mysql-client/src/test/java/io/vertx/tests/mysqlclient/MySQLQueryTest.java index 3d74f4aed..737bdf3ad 100644 --- a/vertx-mysql-client/src/test/java/io/vertx/tests/mysqlclient/MySQLQueryTest.java +++ b/vertx-mysql-client/src/test/java/io/vertx/tests/mysqlclient/MySQLQueryTest.java @@ -11,6 +11,7 @@ package io.vertx.tests.mysqlclient; +import io.netty.util.internal.PlatformDependent; import io.vertx.core.Vertx; import io.vertx.core.buffer.Buffer; import io.vertx.core.file.FileSystem; @@ -32,6 +33,8 @@ import java.util.List; import java.util.concurrent.ThreadLocalRandom; +import static org.junit.Assume.assumeFalse; + @RunWith(VertxUnitRunner.class) public class MySQLQueryTest extends MySQLTestBase { @@ -308,6 +311,8 @@ public void testEncodePacketSizeMoreThan16MB(TestContext ctx) { @Test public void testLocalInfileRequest(TestContext ctx) { + assumeFalse(PlatformDependent.isWindows()); + FileSystem fileSystem = vertx.fileSystem(); Buffer fileData = Buffer.buffer(); for (int i = 0; i < 10000; i++) { @@ -373,6 +378,8 @@ public void testLocalInfileRequest(TestContext ctx) { @Test public void testLocalInfileRequestEmptyFile(TestContext ctx) { + assumeFalse(PlatformDependent.isWindows()); + FileSystem fileSystem = vertx.fileSystem(); Buffer fileData = Buffer.buffer(); fileSystem @@ -406,6 +413,8 @@ public void testLocalInfileRequestEmptyFile(TestContext ctx) { @Test public void testLocalInfileRequestInPackets(TestContext ctx) { + assumeFalse(PlatformDependent.isWindows()); + FileSystem fileSystem = vertx.fileSystem(); Buffer fileData = Buffer.buffer(); for (int i = 0; i < 200000; i++) { diff --git a/vertx-mysql-client/src/test/java/io/vertx/tests/mysqlclient/junit/MySQLRule.java b/vertx-mysql-client/src/test/java/io/vertx/tests/mysqlclient/junit/MySQLRule.java index c1347ee6d..b184dec0f 100644 --- a/vertx-mysql-client/src/test/java/io/vertx/tests/mysqlclient/junit/MySQLRule.java +++ b/vertx-mysql-client/src/test/java/io/vertx/tests/mysqlclient/junit/MySQLRule.java @@ -11,6 +11,7 @@ package io.vertx.tests.mysqlclient.junit; import com.github.dockerjava.api.model.Ulimit; +import io.netty.util.internal.PlatformDependent; import io.vertx.mysqlclient.MySQLConnectOptions; import io.vertx.mysqlclient.SslMode; import org.junit.rules.ExternalResource; @@ -96,13 +97,14 @@ private void initServer() throws IOException { server.withExposedPorts(DEFAULT_PORT); } - - mysqldDir = Files.createTempDirectory("mysqld").toFile(); - mysqldDir.deleteOnExit(); - mysqldDir.setReadable(true, false); - mysqldDir.setWritable(true, false); - mysqldDir.setExecutable(true, false); - server.withFileSystemBind(mysqldDir.getAbsolutePath(), "/var/run/mysqld"); + if (!PlatformDependent.isWindows()) { + mysqldDir = Files.createTempDirectory("mysqld").toFile(); + mysqldDir.deleteOnExit(); + mysqldDir.setReadable(true, false); + mysqldDir.setWritable(true, false); + mysqldDir.setExecutable(true, false); + server.withFileSystemBind(mysqldDir.getAbsolutePath(), "/var/run/mysqld"); + } if (ssl) { server.withClasspathResourceMapping("tls/conf", "/etc/mysql/conf.d", BindMode.READ_ONLY); From 64e10fa763129ddea756abf16411af3fea4b5cff Mon Sep 17 00:00:00 2001 From: Thomas Segismont Date: Mon, 30 Nov 2026 16:53:21 +0100 Subject: [PATCH 2/5] Add .gitattributes to keep container-mounted resources as LF - Force LF for shell scripts, SQL files and configuration files mounted into test containers - Treat TLS certificates and keys as binary - Prevents CRLF breakage on Windows checkouts where test containers exit with code 127 Assisted-by: AAIF Goose (GLM 5.3, rits/zai-org/glm-5-3) Signed-off-by: Thomas Segismont --- .gitattributes | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..cace460b7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,18 @@ +# Some test resources are copied or mounted into Linux containers +# (database init scripts, TLS material, etc. used by Testcontainers rules). +# These files must always be checked out with LF line endings, otherwise +# containers fail on Windows working copies (e.g. "/bin/sh^M: bad interpreter"). + +# Shell scripts executed inside Linux containers +*.sh text eol=lf + +# SQL and configuration files mounted into database containers +*.sql text eol=lf +*.conf text eol=lf +*.cnf text eol=lf +*.ini text eol=lf + +# Certificate and key material must never be rewritten +*.crt -text +*.key -text +*.pem -text From 8f0c3b9c7396e222f68df94b2cdf93422351dcbc Mon Sep 17 00:00:00 2001 From: Thomas Segismont Date: Mon, 30 Nov 2026 16:53:21 +0100 Subject: [PATCH 3/5] Use locale-independent numeric defaults in Oracle tests - Replace quoted numeric column defaults such as DEFAULT '42.42' with unquoted literals - ojdbc derives the session NLS_NUMERIC_CHARACTERS from the JVM default locale, so quoted defaults fail with ORA-01722 under non-English locales (e.g. fr-FR) - Unquoted numeric literals are locale-independent Assisted-by: AAIF Goose (GLM 5.3, rits/zai-org/glm-5-3) Signed-off-by: Thomas Segismont --- .../tests/oracleclient/OracleGeneratedKeysTestBase.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vertx-oracle-client/src/test/java/tests/oracleclient/OracleGeneratedKeysTestBase.java b/vertx-oracle-client/src/test/java/tests/oracleclient/OracleGeneratedKeysTestBase.java index 7efee6ba2..90592ccfa 100644 --- a/vertx-oracle-client/src/test/java/tests/oracleclient/OracleGeneratedKeysTestBase.java +++ b/vertx-oracle-client/src/test/java/tests/oracleclient/OracleGeneratedKeysTestBase.java @@ -57,9 +57,9 @@ public abstract class OracleGeneratedKeysTestBase extends OracleTestBase { " localDateTime TIMESTAMP DEFAULT timestamp '2018-11-04 00:00:00' NOT NULL,\n" + " inte NUMBER(10) DEFAULT 42 NOT NULL,\n" + " longe NUMBER(19) DEFAULT 84 NOT NULL,\n" + - " floate BINARY_FLOAT DEFAULT '42.42' NOT NULL,\n" + - " doublee BINARY_DOUBLE DEFAULT '84.84' NOT NULL,\n" + - " bigDecimal NUMBER(3, 1) DEFAULT '4.2' NOT NULL,\n" + + " floate BINARY_FLOAT DEFAULT 42.42 NOT NULL,\n" + + " doublee BINARY_DOUBLE DEFAULT 84.84 NOT NULL,\n" + + " bigDecimal NUMBER(3, 1) DEFAULT 4.2 NOT NULL,\n" + " offsetDateTime TIMESTAMP WITH TIME ZONE DEFAULT timestamp '2019-11-04 00:00:00 +01:02' NOT NULL,\n" + " PRIMARY KEY (id)\n" + ")"; From 778be187330866112eb9496116ba9f8ca263151e Mon Sep 17 00:00:00 2001 From: Thomas Segismont Date: Mon, 30 Nov 2026 16:53:21 +0100 Subject: [PATCH 4/5] Run DB2 test container privileged by default - Podman mounts container volumes with nosuid, which prevents the DB2 setuid binaries from running - The entrypoint then fails with SQL1641N, surfaced as SQL1042C, and the database is never created - Privileged mode mounts the /database volume without nosuid and the instance starts normally Assisted-by: AAIF Goose (GLM 5.3, rits/zai-org/glm-5-3) Signed-off-by: Thomas Segismont --- .../java/io/vertx/tests/db2client/junit/DB2Resource.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vertx-db2-client/src/test/java/io/vertx/tests/db2client/junit/DB2Resource.java b/vertx-db2-client/src/test/java/io/vertx/tests/db2client/junit/DB2Resource.java index 5b053d961..0e987e648 100644 --- a/vertx-db2-client/src/test/java/io/vertx/tests/db2client/junit/DB2Resource.java +++ b/vertx-db2-client/src/test/java/io/vertx/tests/db2client/junit/DB2Resource.java @@ -39,7 +39,11 @@ public class DB2Resource extends ExternalResource { private final GenericContainer instance = new GenericContainer<>("icr.io/db2_community/db2:" + CONTAINER_VERSION) .withCreateContainerCmdModifier(cmd -> cmd .withCapAdd(Capability.IPC_LOCK) - .withCapAdd(Capability.IPC_OWNER)) + .withCapAdd(Capability.IPC_OWNER) + // Podman mounts container volumes with nosuid, which prevents the DB2 setuid + // binaries (db2start & friends) from running: the entrypoint fails with SQL1641N, + // surfaced as SQL1042C. Privileged mode mounts /database without nosuid. + .withPrivileged(true)) .withEnv("LICENSE", "accept") .withEnv("DB2INSTANCE", "vertx") .withEnv("DB2INST1_PASSWORD", "vertx") From 6cafc54dc0f1672a68c3e6f894d3dadedbbb70c0 Mon Sep 17 00:00:00 2001 From: Thomas Segismont Date: Mon, 30 Nov 2026 16:53:22 +0100 Subject: [PATCH 5/5] 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 --- .../tests/pgclient/PgConnectionTest.java | 8 ++++++++ .../tests/pgclient/tck/PgConnectionTest.java | 19 +++++++++++++++++++ .../src/test/java/module-info.java | 1 + 3 files changed, 28 insertions(+) diff --git a/vertx-pg-client/src/test/java/io/vertx/tests/pgclient/PgConnectionTest.java b/vertx-pg-client/src/test/java/io/vertx/tests/pgclient/PgConnectionTest.java index 91711ebb0..0fc06b8a7 100644 --- a/vertx-pg-client/src/test/java/io/vertx/tests/pgclient/PgConnectionTest.java +++ b/vertx-pg-client/src/test/java/io/vertx/tests/pgclient/PgConnectionTest.java @@ -17,6 +17,7 @@ package io.vertx.tests.pgclient; +import io.netty.util.internal.PlatformDependent; import io.vertx.ext.unit.Async; import io.vertx.ext.unit.TestContext; import io.vertx.pgclient.PgConnection; @@ -28,6 +29,7 @@ import java.util.ArrayList; import java.util.List; +import static org.junit.Assume.assumeFalse; /** * @author Julien Viet @@ -84,6 +86,9 @@ public void testBatchUpdate(TestContext ctx) { @Test public void testQueueQueries(TestContext ctx) { + // Skipped on Windows: the podman/WSL2 port-forwarding proxy tears the connection on the + // TCP half-close sent by PgEncoder after Terminate, losing in-flight server responses + assumeFalse(PlatformDependent.isWindows()); int num = 1000; Async async = ctx.async(num + 1); connector.accept(ctx.asyncAssertSuccess(conn -> { @@ -111,6 +116,9 @@ public void testQueueQueries(TestContext ctx) { @Test public void testCancelRequest(TestContext ctx) { + // Skipped on Windows: the podman/WSL2 port-forwarding proxy tears the connection on the + // TCP half-close sent by PgEncoder after Terminate, losing in-flight server responses + assumeFalse(PlatformDependent.isWindows()); Async async = ctx.async(2); connector.accept(ctx.asyncAssertSuccess(conn -> { conn diff --git a/vertx-pg-client/src/test/java/io/vertx/tests/pgclient/tck/PgConnectionTest.java b/vertx-pg-client/src/test/java/io/vertx/tests/pgclient/tck/PgConnectionTest.java index cf7c54664..5b0008874 100644 --- a/vertx-pg-client/src/test/java/io/vertx/tests/pgclient/tck/PgConnectionTest.java +++ b/vertx-pg-client/src/test/java/io/vertx/tests/pgclient/tck/PgConnectionTest.java @@ -11,6 +11,7 @@ package io.vertx.tests.pgclient.tck; +import io.netty.util.internal.PlatformDependent; import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.junit.VertxUnitRunner; import io.vertx.sqlclient.spi.DatabaseMetadata; @@ -19,6 +20,8 @@ import org.junit.ClassRule; import org.junit.runner.RunWith; +import static org.junit.Assume.assumeFalse; + @RunWith(VertxUnitRunner.class) public class PgConnectionTest extends ConnectionTestBase { @ClassRule @@ -37,6 +40,22 @@ public void tearDown(TestContext ctx) { super.tearDown(ctx); } + @Override + public void testCloseWithQueryInProgress(TestContext ctx) { + // Skipped on Windows: the podman/WSL2 port-forwarding proxy tears the connection on the + // TCP half-close sent by PgEncoder after Terminate, losing in-flight server responses + assumeFalse(PlatformDependent.isWindows()); + super.testCloseWithQueryInProgress(ctx); + } + + @Override + public void testCloseWithErrorInProgress(TestContext ctx) { + // Skipped on Windows: the podman/WSL2 port-forwarding proxy tears the connection on the + // TCP half-close sent by PgEncoder after Terminate, losing in-flight server responses + assumeFalse(PlatformDependent.isWindows()); + super.testCloseWithErrorInProgress(ctx); + } + @Override protected void validateDatabaseMetaData(TestContext ctx, DatabaseMetadata md) { ctx.assertTrue(md.majorVersion() >= 9); diff --git a/vertx-pg-client/src/test/java/module-info.java b/vertx-pg-client/src/test/java/module-info.java index 9cb5ec5b2..160958fce 100644 --- a/vertx-pg-client/src/test/java/module-info.java +++ b/vertx-pg-client/src/test/java/module-info.java @@ -1,5 +1,6 @@ open module io.vertx.tests.sql.client.pg { + requires io.netty.common; requires io.netty.buffer; requires io.netty.transport; requires com.ongres.scram.client;