Yes, this fixes the issue. With shutdown() the tests succeed reliably, with stop() they reliably didn’t. -- Marco Roeland
Op 27 dec. 2013, om 13:12 heeft Harry Metske (JIRA) <[email protected]> het volgende geschreven: > > [ > https://issues.apache.org/jira/browse/JSPWIKI-808?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13857458#comment-13857458 > ] > > Harry Metske commented on JSPWIKI-808: > -------------------------------------- > > Should be fixed in 2.10.0-svn-60. > I simply replaced the Server.stop() by the Server.shutdown() method. > Let me know if this helps (I could not reproduce the problem), before closing > the issue. > >> Refactor of o.a.w.HsqlDbUtils.stop() >> ------------------------------------ >> >> Key: JSPWIKI-808 >> URL: https://issues.apache.org/jira/browse/JSPWIKI-808 >> Project: JSPWiki >> Issue Type: Improvement >> Components: Unit Testing >> Reporter: Juan Pablo Santos Rodríguez >> Priority: Minor >> >> Snipping texts from the dev ML: >> {quote} >> *\[...]* >> 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 Hsql >> Waits 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. >> {quote} >> This approach was included as part of 2.10.0-svn-59. However, the >> org.hsqldb.Server.stop() javadoc states: >> {quote} >> 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 >> {quote} >> Possible approaches: >> * polling >> * subclassing (as per javadoc) >> * starting / stopping the Server for the whole test >> * use >> [innodb-maven-plugin|https://github.com/bmatthews68/inmemdb-maven-plugin], >> which is already used by IT tests (note that this may require to launch >> maven to run the unit test) > > > > -- > This message was sent by Atlassian JIRA > (v6.1.5#6160)
