Skip to content

Commit 1ff4664

Browse files
committed
browserTimeout is in seconds, treat the value as such
Fixes #2205
1 parent 0b1642c commit 1ff4664

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

java/server/src/org/openqa/grid/internal/TestSession.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
import java.util.HashMap;
6060
import java.util.Map;
6161
import java.util.UUID;
62+
import java.util.concurrent.TimeUnit;
6263
import java.util.logging.Logger;
6364

6465
import javax.servlet.http.HttpServletRequest;
@@ -193,13 +194,13 @@ public String toString() {
193194

194195
private HttpClient getClient() {
195196
Registry reg = slot.getProxy().getRegistry();
196-
int browserTimeout = reg.getConfiguration().browserTimeout;
197-
if (browserTimeout > 0) {
198-
final int selenium_server_cleanup_cycle = browserTimeout / 10;
197+
long browserTimeout = TimeUnit.SECONDS.toMillis(reg.getConfiguration().browserTimeout);
198+
if (browserTimeout > 0){
199+
final long selenium_server_cleanup_cycle = browserTimeout / 10;
199200
browserTimeout += (selenium_server_cleanup_cycle + MAX_NETWORK_LATENCY);
200201
browserTimeout *=2; // Lets not let this happen too often
201202
}
202-
return slot.getProxy().getHttpClientFactory().getGridHttpClient(browserTimeout, browserTimeout);
203+
return slot.getProxy().getHttpClientFactory().getGridHttpClient((int)browserTimeout, (int)browserTimeout);
203204
}
204205

205206
/*

0 commit comments

Comments
 (0)