postgresql-jdbc.git / summary / log / commit / refs

commit    ecd412e4164bbfcccd96f778c874dd4f40330354
Author:   Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
Commit:   GitHub <noreply@github.com>
Date:     Sun Jul 22 11:57:38 2018 +0000

    test: run testShortQueryTimeout in PG_VERSION=HEAD Travis job only (#1270)


.../test/java/org/postgresql/test/jdbc2/StatementTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 5d934b62..bdbf2d5d 100644 --- a/pgjdbc/src/test/java/org/postgresql/test/jdbc2/StatementTest.java +++ b/pgjdbc/src/test/java/org/postgresql/test/jdbc2/StatementTest.java @@ -19,6 +19,7 @@ import org.postgresql.util.PSQLState; import org.junit.After; import org.junit.Assert; +import org.junit.Assume; import org.junit.Before; import org.junit.Test; @@ -72,6 +73,15 @@ public class StatementTest { con.close(); } + private void assumeLongTest() { + // Run the test: + // Travis: in PG_VERSION=HEAD + // Other: always + if ("true".equals(System.getenv("TRAVIS"))) { + Assume.assumeTrue("HEAD".equals(System.getenv("PG_VERSION"))); + } + } + @Test public void testClose() throws SQLException { Statement stmt = con.createStatement(); @@ -712,6 +722,8 @@ public class StatementTest { */ @Test public void testShortQueryTimeout() throws SQLException { + assumeLongTest(); + long deadLine = System.currentTimeMillis() + 10000; Statement stmt = con.createStatement(); ((PgStatement) stmt).setQueryTimeoutMs(1); [parent: 1f8ac4063b1f]