Permalink
Browse files

test: avoid "The connection attempt failed" in ConnectTimeoutTest.tes…

…tTimeout

Unexpected org.postgresql.util.PSQLException: The connection attempt failed.
	at junit.framework.Assert.fail(Assert.java:57)
	at junit.framework.Assert.assertTrue(Assert.java:22)
	at org.postgresql.test.jdbc2.ConnectTimeoutTest.testTimeout(ConnectTimeoutTest.java:35)

closes #531
  • Loading branch information...
vlsi committed Mar 7, 2016
1 parent 91f05b4 commit fbabfa4e69aeaf7a9e69a0801740b22b141bcb47
Showing with 4 additions and 3 deletions.
  1. +4 −3 pgjdbc/src/test/java/org/postgresql/test/jdbc2/ConnectTimeoutTest.java
@@ -11,9 +11,10 @@
import java.util.Properties;
public class ConnectTimeoutTest extends TestCase {
private static final String UNREACHABLE_HOST = "1.0.0.0";
private static final String UNREACHABLE_URL = "jdbc:postgresql://" + UNREACHABLE_HOST + "/test";
private static final int CONNECT_TIMEOUT = 10;
// The IP below is non-routable (see http://stackoverflow.com/a/904609/1261287)
private static final String UNREACHABLE_HOST = "10.255.255.1";
private static final String UNREACHABLE_URL = "jdbc:postgresql://" + UNREACHABLE_HOST + ":5432/test";
private static final int CONNECT_TIMEOUT = 5;
@Override
protected void setUp() throws Exception {

0 comments on commit fbabfa4

Please sign in to comment.