Skip to content

Commit be211fc

Browse files
committed
cp: timeout
1 parent f605b73 commit be211fc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

java/server/src/org/openqa/selenium/remote/server/DriverServlet.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ public void init() throws ServletException {
108108
inactiveSessionTimeoutMs,
109109
individualCommandTimeoutMs);
110110
}
111+
112+
// Alright. It's nonsense that the individualCommandTimeout isn't a sensible value.
113+
if (individualCommandTimeoutMs == 0) {
114+
individualCommandTimeoutMs = Math.min(inactiveSessionTimeoutMs, Long.MAX_VALUE);
115+
}
111116
}
112117

113118
@VisibleForTesting
@@ -289,8 +294,7 @@ protected void handleRequest(
289294
}
290295
});
291296
try {
292-
long timeout = individualCommandTimeoutMs == 0 ? Long.MAX_VALUE : individualCommandTimeoutMs;
293-
future.get(timeout, MILLISECONDS);
297+
future.get(getIndividualCommandTimeoutMs(), MILLISECONDS);
294298
} catch (InterruptedException e) {
295299
writeThrowable(servletResponse, e);
296300
} catch (ExecutionException e) {

0 commit comments

Comments
 (0)