Make connection initialization timeout constant 39/8739/1
authorDave Tucker <djt@redhat.com>
Mon, 7 Jul 2014 14:10:11 +0000 (15:10 +0100)
committerDave Tucker <djt@redhat.com>
Mon, 7 Jul 2014 14:10:11 +0000 (15:10 +0100)
Fix bug 1294

Change-Id: I427522b642e8a98796f397c901b93a887976b8cd
Signed-off-by: Dave Tucker <djt@redhat.com>
integrationtest/src/test/java/org/opendaylight/ovsdb/integrationtest/OvsdbIntegrationTestBase.java

index 9a921cf56b4125926a33f07e9eea3bb4d840c65d..e6b52fd85be8c0860c8776dca1ee4e43c65565fe 100644 (file)
@@ -43,6 +43,7 @@ public abstract class OvsdbIntegrationTestBase {
     protected final static String CONNECTION_TYPE = "ovsdbserver.connection";
     protected final static String CONNECTION_TYPE_ACTIVE = "active";
     protected final static String CONNECTION_TYPE_PASSIVE = "passive";
+    protected final static int CONNECTION_INIT_TIMEOUT = 10000;
 
     protected final static String DEFAULT_SERVER_PORT = "6640";
 
@@ -75,8 +76,8 @@ public abstract class OvsdbIntegrationTestBase {
             params.put(ConnectionConstants.PORT, portStr);
             return connection.connect(IDENTIFIER, params);
         }  else if (connectionType.equalsIgnoreCase(CONNECTION_TYPE_PASSIVE)) {
-            // Wait for 10 seconds for the Passive connection to be initiated by the ovsdb-server.
-            Thread.sleep(10000);
+            // Wait for CONNECTION_INIT_TIMEOUT for the Passive connection to be initiated by the ovsdb-server.
+            Thread.sleep(CONNECTION_INIT_TIMEOUT);
             List<Node> nodes = connection.getNodes();
             assertNotNull(nodes);
             assertTrue(nodes.size() > 0);