Permalink
Browse files

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

  • Loading branch information...
vlsi committed Jul 22, 2018
1 parent 1f8ac40 commit ecd412e4164bbfcccd96f778c874dd4f40330354
Showing with 12 additions and 0 deletions.
  1. +12 −0 pgjdbc/src/test/java/org/postgresql/test/jdbc2/StatementTest.java
@@ -19,6 +19,7 @@

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 void tearDown() throws Exception {
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 void testLongQueryTimeout() throws SQLException {
*/
@Test
public void testShortQueryTimeout() throws SQLException {
assumeLongTest();

long deadLine = System.currentTimeMillis() + 10000;
Statement stmt = con.createStatement();
((PgStatement) stmt).setQueryTimeoutMs(1);

0 comments on commit ecd412e

Please sign in to comment.