diff --git a/pgjdbc/src/test/java/org/postgresql/replication/LogicalReplicationTest.java b/pgjdbc/src/test/java/org/postgresql/replication/LogicalReplicationTest.java index 90dc2348a9..7cbd370ab5 100644 --- a/pgjdbc/src/test/java/org/postgresql/replication/LogicalReplicationTest.java +++ b/pgjdbc/src/test/java/org/postgresql/replication/LogicalReplicationTest.java @@ -82,7 +82,7 @@ void tearDown() throws Exception { } @Test - @Timeout(1000) + @Timeout(1) void notAvailableStartNotExistReplicationSlot() throws Exception { PGConnection pgConnection = (PGConnection) replConnection; @@ -112,7 +112,7 @@ state, equalTo(PSQLState.UNDEFINED_OBJECT.getState()) } @Test - @Timeout(1000) + @Timeout(1) void receiveChangesOccursBeforeStartReplication() throws Exception { PGConnection pgConnection = (PGConnection) replConnection; @@ -150,7 +150,7 @@ result, equalTo(wait) } @Test - @Timeout(1000) + @Timeout(1) void receiveChangesAfterStartReplication() throws Exception { PGConnection pgConnection = (PGConnection) replConnection; @@ -201,7 +201,7 @@ groupedResult, equalTo(wait) } @Test - @Timeout(1000) + @Timeout(1) void startFromCurrentServerLSNWithoutSpecifyLSNExplicitly() throws Exception { PGConnection pgConnection = (PGConnection) replConnection; @@ -233,7 +233,7 @@ void startFromCurrentServerLSNWithoutSpecifyLSNExplicitly() throws Exception { } @Test - @Timeout(1000) + @Timeout(1) void afterStartStreamingDBSlotStatusActive() throws Exception { PGConnection pgConnection = (PGConnection) replConnection; @@ -264,7 +264,7 @@ isActive, equalTo(true) * wait new changes and until waiting messages from client ignores.

*/ @Test - @Timeout(1000) + @Timeout(1) @HaveMinimalServerVersion("11.1") void afterCloseReplicationStreamDBSlotStatusNotActive() throws Exception { PGConnection pgConnection = (PGConnection) replConnection; @@ -292,7 +292,7 @@ isActive, equalTo(false) } @Test - @Timeout(1000) + @Timeout(1) void afterCloseConnectionDBSLotStatusNotActive() throws Exception { PGConnection pgConnection = (PGConnection) replConnection; @@ -337,7 +337,7 @@ isActive, equalTo(false) * wait new changes and until waiting messages from client ignores.

*/ @Test - @Timeout(10000) + @Timeout(10) @HaveMinimalServerVersion("12.1") void duringSendBigTransactionConnectionCloseSlotStatusNotActive() throws Exception { PGConnection pgConnection = (PGConnection) replConnection; @@ -392,7 +392,7 @@ isActive, equalTo(false) * wait new changes and until waiting messages from client ignores.

*/ @Test - @Timeout(60000) + @Timeout(60) @HaveMinimalServerVersion("11.1") void duringSendBigTransactionReplicationStreamCloseNotActive() throws Exception { PGConnection pgConnection = (PGConnection) replConnection; @@ -429,7 +429,7 @@ isActive, equalTo(false) //todo fix, fail because backend for logical decoding not reply with CommandComplate & ReadyForQuery @Test - @Timeout(5000) + @Timeout(5) void repeatWalPositionTwice() throws Exception { PGConnection pgConnection = (PGConnection) replConnection; @@ -489,7 +489,7 @@ groupedResult, equalTo(wait) } @Test - @Timeout(3000) + @Timeout(3) void doesNotHavePendingMessageWhenStartFromLastLSN() throws Exception { PGConnection pgConnection = (PGConnection) replConnection; @@ -512,7 +512,7 @@ result, equalTo(null) } @Test - @Timeout(3000) + @Timeout(3) void readPreviousChangesWithoutBlock() throws Exception { PGConnection pgConnection = (PGConnection) replConnection; @@ -549,7 +549,7 @@ received, equalTo(wait) } @Test - @Timeout(3000) + @Timeout(3) void readActualChangesWithoutBlock() throws Exception { PGConnection pgConnection = (PGConnection) replConnection; @@ -584,7 +584,7 @@ received, equalTo(wait) } @Test - @Timeout(10000) + @Timeout(10) void avoidTimeoutDisconnectWithDefaultStatusInterval() throws Exception { final int statusInterval = getKeepAliveTimeout(); diff --git a/pgjdbc/src/test/java/org/postgresql/test/jdbc2/NotifyTest.java b/pgjdbc/src/test/java/org/postgresql/test/jdbc2/NotifyTest.java index 7b0fc2dffc..4740a5ac8b 100644 --- a/pgjdbc/src/test/java/org/postgresql/test/jdbc2/NotifyTest.java +++ b/pgjdbc/src/test/java/org/postgresql/test/jdbc2/NotifyTest.java @@ -39,7 +39,7 @@ void tearDown() throws SQLException { } @Test - @Timeout(60000) + @Timeout(60) void testNotify() throws SQLException { Statement stmt = conn.createStatement(); stmt.executeUpdate("LISTEN mynotification"); @@ -55,7 +55,7 @@ void testNotify() throws SQLException { } @Test - @Timeout(60000) + @Timeout(60) void notifyArgument() throws Exception { if (!TestUtil.haveMinimumServerVersion(conn, ServerVersion.v9_0)) { return; @@ -75,7 +75,7 @@ void notifyArgument() throws Exception { } @Test - @Timeout(60000) + @Timeout(60) void asyncNotify() throws Exception { Statement stmt = conn.createStatement(); stmt.executeUpdate("LISTEN mynotification"); @@ -109,7 +109,7 @@ void asyncNotify() throws Exception { * listener is blocking. */ @Test - @Timeout(60000) + @Timeout(60) void asyncNotifyWithTimeout() throws Exception { Statement stmt = conn.createStatement(); stmt.executeUpdate("LISTEN mynotification"); @@ -126,7 +126,7 @@ void asyncNotifyWithTimeout() throws Exception { } @Test - @Timeout(60000) + @Timeout(60) void asyncNotifyWithTimeoutAndMessagesAvailableWhenStartingListening() throws Exception { Statement stmt = conn.createStatement(); stmt.executeUpdate("LISTEN mynotification"); @@ -145,7 +145,7 @@ void asyncNotifyWithTimeoutAndMessagesAvailableWhenStartingListening() throws Ex } @Test - @Timeout(60000) + @Timeout(60) void asyncNotifyWithEndlessTimeoutAndMessagesAvailableWhenStartingListening() throws Exception { Statement stmt = conn.createStatement(); stmt.executeUpdate("LISTEN mynotification"); @@ -163,7 +163,7 @@ void asyncNotifyWithEndlessTimeoutAndMessagesAvailableWhenStartingListening() th } @Test - @Timeout(60000) + @Timeout(60) void asyncNotifyWithTimeoutAndMessagesSendAfter() throws Exception { Statement stmt = conn.createStatement(); stmt.executeUpdate("LISTEN mynotification"); @@ -191,7 +191,7 @@ public void run() { } @Test - @Timeout(60000) + @Timeout(60) void asyncNotifyWithEndlessTimeoutAndMessagesSendAfter() throws Exception { Statement stmt = conn.createStatement(); stmt.executeUpdate("LISTEN mynotification"); @@ -219,7 +219,7 @@ public void run() { } @Test - @Timeout(60000) + @Timeout(60) void asyncNotifyWithTimeoutAndSocketThatBecomesClosed() throws Exception { Statement stmt = conn.createStatement(); stmt.executeUpdate("LISTEN mynotification"); diff --git a/pgjdbc/src/test/java/org/postgresql/test/jdbc2/StatementTest.java b/pgjdbc/src/test/java/org/postgresql/test/jdbc2/StatementTest.java index 8137f0dec4..9ea4b2db71 100644 --- a/pgjdbc/src/test/java/org/postgresql/test/jdbc2/StatementTest.java +++ b/pgjdbc/src/test/java/org/postgresql/test/jdbc2/StatementTest.java @@ -864,7 +864,7 @@ void multipleCancels() throws Exception { } @Test - @Timeout(30000) + @Timeout(30) void cancelQueryWithBrokenNetwork() throws SQLException, IOException, InterruptedException { // check that stmt.cancel() doesn't hang forever if the network is broken @@ -892,7 +892,7 @@ void cancelQueryWithBrokenNetwork() throws SQLException, IOException, Interrupte } @Test - @Timeout(10000) + @Timeout(10) void closeInProgressStatement() throws Exception { ExecutorService executor = Executors.newSingleThreadExecutor(); final Connection outerLockCon = TestUtil.openDB(); @@ -951,7 +951,7 @@ public Void call() throws Exception { } @Test - @Timeout(10000) + @Timeout(10) void concurrentIsValid() throws Throwable { ExecutorService executor = Executors.newCachedThreadPool(); try { @@ -997,7 +997,7 @@ void concurrentIsValid() throws Throwable { } @Test - @Timeout(20000) + @Timeout(20) void fastCloses() throws SQLException { ExecutorService executor = Executors.newSingleThreadExecutor(); con.createStatement().execute("SET SESSION client_min_messages = 'NOTICE'"); diff --git a/pgjdbc/src/test/java/org/postgresql/test/jdbc4/ConnectionValidTimeoutTest.java b/pgjdbc/src/test/java/org/postgresql/test/jdbc4/ConnectionValidTimeoutTest.java index d6bd45f3f4..cbc35fc610 100644 --- a/pgjdbc/src/test/java/org/postgresql/test/jdbc4/ConnectionValidTimeoutTest.java +++ b/pgjdbc/src/test/java/org/postgresql/test/jdbc4/ConnectionValidTimeoutTest.java @@ -34,7 +34,7 @@ public static Iterable data() { @MethodSource("data") @ParameterizedTest(name = "networkTimeoutMillis={0}, validationTimeoutSeconds={1}, expectedMaxValidationTimeMillis={2}") - @Timeout(value = 30) + @Timeout(30) void isValidRespectsSmallerTimeout(int networkTimeoutMillis, int validationTimeoutSeconds, int expectedMaxValidationTimeMillis) throws Exception { try (StrangeProxyServer proxyServer = new StrangeProxyServer(TestUtil.getServer(), TestUtil.getPort())) { final Properties props = new Properties();