File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
java/src/org/openqa/selenium/os Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -265,7 +265,21 @@ public boolean waitFor(Duration duration) throws InterruptedException {
265
265
boolean exited = process .waitFor (duration .toMillis (), TimeUnit .MILLISECONDS );
266
266
267
267
if (exited ) {
268
- worker .join ();
268
+ try {
269
+ // the worker might not stop even when process.destroyForcibly is called
270
+ worker .join (8000 );
271
+ } catch (InterruptedException ex ) {
272
+ Thread .interrupted ();
273
+ } finally {
274
+ // if already stopped interrupt is ignored, otherwise raises I/O exceptions in the worker
275
+ worker .interrupt ();
276
+ try {
277
+ // now we might be able to join
278
+ worker .join (2000 );
279
+ } catch (InterruptedException ex ) {
280
+ Thread .interrupted ();
281
+ }
282
+ }
269
283
}
270
284
271
285
return exited ;
You can’t perform that action at this time.
0 commit comments