Skip to content

Commit 98fcedc

Browse files
authored
test: Improve test resilience if startForUnitTests fails (#6645)
1 parent 953c91e commit 98fcedc

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

server/src/main/java/io/deephaven/server/runner/DeephavenApiServer.java

+10-5
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,17 @@ public void join() throws InterruptedException {
237237

238238
void startForUnitTests() throws Exception {
239239
setInstance(this);
240-
pluginRegistration.registerAll();
241-
applicationInjector.run();
242-
executionContextProvider.get().getQueryLibrary().updateVersionString("DEFAULT");
240+
try {
241+
pluginRegistration.registerAll();
242+
applicationInjector.run();
243+
executionContextProvider.get().getQueryLibrary().updateVersionString("DEFAULT");
243244

244-
log.info().append("Starting server...").endl();
245-
server.start();
245+
log.info().append("Starting server...").endl();
246+
server.start();
247+
} catch (Exception e) {
248+
clearInstance(this);
249+
throw e;
250+
}
246251
}
247252

248253
void teardownForUnitTests() throws InterruptedException {

0 commit comments

Comments
 (0)