Skip to content

Commit 60e3171

Browse files
committed
[java] close the running Server in unittests if a retry is needed
1 parent 192b2d5 commit 60e3171

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

java/test/org/openqa/selenium/environment/webserver/NettyAppServer.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,16 @@ public void start() {
149149
() -> {
150150
server.start();
151151
if (secure != null) {
152-
secure.start();
152+
try {
153+
secure.start();
154+
} catch (Exception e) {
155+
try {
156+
server.stop();
157+
} catch (Exception ex) {
158+
e.addSuppressed(ex);
159+
throw e;
160+
}
161+
}
153162
}
154163
});
155164
}

0 commit comments

Comments
 (0)