Skip to content

Commit 9e12eb0

Browse files
author
Wenjun Che
committed
ADAP-42: read connect timeout from com.openfin.demo.runtime.connect.wait.time
1 parent a1236bd commit 9e12eb0

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/main/java/com/openfin/desktop/demo/OpenFinWindowTest.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ public static void teardown() throws Exception {
5454

5555
private static void setupDesktopConnection() throws Exception {
5656
CountDownLatch openFinConnectedLatch = new CountDownLatch(1);
57+
// if RVM needs to download the version of Runtime specified, waitTime may need to be increased for slow download
58+
int waitTime = 60;
59+
String swaiTime = java.lang.System.getProperty("com.openfin.demo.runtime.connect.wait.time");
60+
if (swaiTime != null) {
61+
waitTime = Integer.parseInt(swaiTime);
62+
}
5763

5864
desktopConnection = null;
5965
desktopConnection = new DesktopConnection(DESKTOP_UUID);
@@ -85,10 +91,10 @@ public void onMessage(String message) {
8591
public void onOutgoingMessage(String message) {
8692
printf("openfin outgoing message: %s", message);
8793
}
88-
}, 60000);//this timeout (in 4.40.2.9) is ignored
94+
}, waitTime);//this timeout (in 4.40.2.9) is ignored
8995

9096
printf("waiting for desktop to connect");
91-
openFinConnectedLatch.await(20, TimeUnit.SECONDS);
97+
openFinConnectedLatch.await(waitTime, TimeUnit.SECONDS);
9298

9399
if (desktopConnection.isConnected()) {
94100
printf("desktop connected");

0 commit comments

Comments
 (0)