You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Mike Matrigali (JIRA)" <ji...@apache.org> on 2013/04/05 21:01:16 UTC
[jira] [Commented] (DERBY-6101)
NetworkServerTestSetup.getTimeoutErrorMsg may reflect wrong port number
[ https://issues.apache.org/jira/browse/DERBY-6101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13623951#comment-13623951 ]
Mike Matrigali commented on DERBY-6101:
---------------------------------------
not marking as regression.
> NetworkServerTestSetup.getTimeoutErrorMsg may reflect wrong port number
> -----------------------------------------------------------------------
>
> Key: DERBY-6101
> URL: https://issues.apache.org/jira/browse/DERBY-6101
> Project: Derby
> Issue Type: Bug
> Components: Test
> Affects Versions: 10.10.1.1
> Reporter: Myrna van Lunteren
> Priority: Trivial
> Attachments: DerbyNetAutoStartTest.java
>
>
> The method NetworkServerTestSetup.getTimeoutErrorMsg(String) was modified with revisions 1448441 (for DERBY-6085) and 1448941 (DERBY-6012) to show the port number and hostname on timeout. This is very helpful.
> However, it gets the port number from config, and this may not always be the portnumber in use.
> I ran into this by making a mistake in the setUp() method of DerbyNetAutoStartTest, my attempt at converting DerbyNetAutoStart (see DERBY-3838). I did not have an engine shutdown instruction in the setUp.
> The following code (simplified) caused showed the problem:
> int theport = TestConfiguration.getCurrent().getNextAvailablePort()
> System.out.println("the port is " + theport);
> NetworkServerControl ns = NetworkServerTestSetup.getNetworkServerControl(theport);
> NetworkServerTestSetup.waitForServerStart(ns);
> When running with -Dderby.tests.basePort=4100, the port obtained with getNextAvailablePort() was 4104. However, the timeout error message reflects the basePort. I got:
> junit.framework.AssertionFailedError: Timed out waiting for network server to start (localhost:4100)
> at junit.framework.Assert.fail(Assert.java:47)
> at org.apache.derbyTesting.junit.NetworkServerTestSetup.waitForServerStart(NetworkServerTestSetup.java:565)
> at org.apache.derbyTesting.functionTests.tests.derbynet.DerbyNetAutoStartTest.startNetworkServerTrueHelper(DerbyNetAutoStartTest.java:143)
> I'll attach the test at this point in time, to see the behavior, one needs to comment out the line in the setUp() method:
> //TestConfiguration.getCurrent().shutdownEngine();
> The test will pass if the engine is shutdown.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira