Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseOneServerPerSuite swallows exception when stopping the server fails #431

Open
stijn-vanbael-enprove opened this issue Jul 11, 2023 · 1 comment

Comments

@stijn-vanbael-enprove
Copy link

BaseOneServerPerSuite.run lines 168-172 read:

} catch { // In case the suite aborts, ensure the server is stopped
  case ex: Throwable =>
    runningServer.stopServer.close()
    throw ex
}

When runningServer.stopServer.close() throws another exception for any reason, the original exception is completely swallowed. This happens for example when new GuiceApplicationBuilder().configure(config).build() is called with a config property that has a different type than in application.conf. The application fails to start, the implicit lazy val app in BaseOneServerPerSuite is not initialized. runningServer.stopServer.close() tries to access and thus initialize app again, but Akka is already bound to port 25520, and the application fails to start because of a java.net.BindException.

@mkurz
Copy link
Member

mkurz commented Jul 11, 2023

@stijn-vanbael-enprove A pull request with a fix would be highly appreciated, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants