Skip to content

Commit

Permalink
Remove usage of apache common lib in the shutdown hook test
Browse files Browse the repository at this point in the history
  • Loading branch information
manovotn committed Nov 12, 2024
1 parent 3833c26 commit 1b23855
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@
*/
package org.jboss.weld.environment.se.test.shutdown.hook;

import java.net.BindException;
import java.util.concurrent.atomic.AtomicBoolean;

import org.apache.commons.lang3.exception.ExceptionUtils;

import io.undertow.Undertow;
import io.undertow.server.HttpHandler;
import io.undertow.server.HttpServerExchange;
Expand Down Expand Up @@ -49,15 +46,9 @@ static void start() throws InterruptedException {
}
try {
INSTANCE.server.start();
} catch (Exception e) {
// we might have started the server too early, it's stop() action was still in progress, wait a bit and retry
// this was happening with JDK 11 in Jenkins only
if (ExceptionUtils.indexOfType(e, BindException.class) != -1) {
Thread.sleep(2000l);
INSTANCE.server.start();
}
} finally {
STARTED.set(true);
} catch (Exception e) {
throw new IllegalStateException("There was an error starting Undertow server.", e);
}
}

Expand Down

0 comments on commit 1b23855

Please sign in to comment.