check if thread is alive and interrupt it
diff --git a/java/src/org/openqa/selenium/os/ExternalProcess.java b/java/src/org/openqa/selenium/os/ExternalProcess.java index da1ed79..1189d8b 100644 --- a/java/src/org/openqa/selenium/os/ExternalProcess.java +++ b/java/src/org/openqa/selenium/os/ExternalProcess.java
@@ -265,6 +265,9 @@ public boolean waitFor(Duration duration) throws InterruptedException { if (exited) { worker.join(30000); + if (worker.isAlive()) { + worker.interrupt(); + } } return exited; @@ -295,6 +298,9 @@ public void shutdown(Duration timeout) { try { if (process.waitFor(timeout.toMillis(), MILLISECONDS)) { worker.join(30000); + if (worker.isAlive()) { + worker.interrupt(); + } return; } } catch (InterruptedException ex) {