Skip to content

BaseOneServerPerSuite swallows exception when stopping the server fails #431

@stijn-vanbael-enprove

Description

@stijn-vanbael-enprove

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions