Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Snipping texts from the dev ML:
[...]
It seems that tearing down the HSQL server instance isn’t finished yet when the following test starts, leading to the „port already in use” error message.[...]
Workaround for testing HsqlWaits 1000 milliseconds after each test before starting the next. Otherwise
the tests often fail reporting that the listening port of the database
server is already in use.
This approach was included as part of 2.10.0-svn-59. However, the org.hsqldb.Server.stop() javadoc states:
Stops this server asynchronously.
This method returns immediately, regardless of current state. In order to discover the success or failure of this operation, server state must be polled or a subclass of Server must be used that overrides the setState method to provide state change notification.
Returns: the server state noted at entry to this method
Possible approaches:
- polling
- subclassing (as per javadoc)
- starting / stopping the Server for the whole test
- use innodb-maven-plugin, which is already used by IT tests (note that this may require to launch maven to run the unit test)