Derby
  1. Derby
  2. DERBY-4564

Replication tests do not pick up derby.tests.networkServerStartTimeout setting

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.5.3.0
    • Fix Version/s: 10.5.3.1, 10.6.1.0
    • Component/s: Test
    • Labels:
      None
    • Issue & fix info:
      Newcomer, Patch Available

      Description

      The property derby.tests.networkServerStartTimeout is sometimes used with testing to extend the wait for network server when JVM options are specified that make the start very slow, for example, for IBM JVM testing, -Xnoquickstart  is used for some runs. The replication tests do not seem to pick up this property. Even when set to 90000 the tests wait only for 75 seconds.

      testReplication_Local_StateTest_part1_1(org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun_Local_StateTest_part1_1)java.lang.Exception: Could not ping in 150 * 500ms.: DRDA_NoIO.S
      :Could not connect to Derby Network Server on host 127.0.0.1, port 1527: Connection refused
      at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.ping(ReplicationRun.java:2804)
      at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.pingServer(ReplicationRun.java:2776)
      at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.startServer(ReplicationRun.java:2453)
      at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun_Local_StateTest_part1_1.testReplication_Local_StateTest_part1_1(ReplicationRun_Local_StateTest_part1_1.java:86)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:63)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
      at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.runBare(ReplicationRun.java:199)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
      at junit.extensions.TestSetup.run(TestSetup.java:16)

      1. derby-4564_diff.txt
        1 kB
        Kathey Marsden
      2. derby-4564_throwfinalexception_diff.txt
        2 kB
        Kathey Marsden
      3. derby-4564_useseconds_diff.txt
        1 kB
        Kathey Marsden

        Activity

        Hide
        Kathey Marsden added a comment -

        Attached is a patch for this issue. I verified the property is getting picked up by the test in the description and will do a full test run and check in if there are no comments.

        Show
        Kathey Marsden added a comment - Attached is a patch for this issue. I verified the property is getting picked up by the test in the description and will do a full test run and check in if there are no comments.
        Hide
        Dag H. Wanvik added a comment -

        Looks good to me. +1

        Show
        Dag H. Wanvik added a comment - Looks good to me. +1
        Hide
        Kathey Marsden added a comment -

        Running tests, all tests passed, but I saw this exception print to the console during the run. It is right in the code path I changed so a bit worrisome.

        testReplication_Local_3_p5_DERBY_3878 java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(SocketInputStream.java:179)
        at java.net.SocketInputStream.read(SocketInputStream.java:101)
        at org.apache.derby.impl.drda.NetworkServerControlImpl.fillReplyBuffer(NetworkServerControlImpl.java:2809)
        at org.apache.derby.impl.drda.NetworkServerControlImpl.readResult(NetworkServerControlImpl.java:2753)
        at org.apache.derby.impl.drda.NetworkServerControlImpl.pingWithNoOpen(NetworkServerControlImpl.java:1214)
        at org.apache.derby.impl.drda.NetworkServerControlImpl.ping(NetworkServerControlImpl.java:1189)
        at org.apache.derby.drda.NetworkServerControl.ping(NetworkServerControl.java:395)
        at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.ping(ReplicationRun.java:2632)
        at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.pingServer(ReplicationRun.java:26
        19)
        at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.startServer(ReplicationRun.java:2
        291)
        at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun_Local_3_p5.testReplication_Local_
        3_p5_DERBY_3878(ReplicationRun_Local_3_p5.java:100)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:599)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
        at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.runBare(ReplicationRun.java:207)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:103)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.extensions.TestSetup.run(TestSetup.java:16)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.textui.TestRunner.doRun(TestRunner.java:116)
        at junit.textui.TestRunner.start(TestRunner.java:172)
        at junit.textui.TestRunner.main(TestRunner.java:138)

        Show
        Kathey Marsden added a comment - Running tests, all tests passed, but I saw this exception print to the console during the run. It is right in the code path I changed so a bit worrisome. testReplication_Local_3_p5_DERBY_3878 java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:179) at java.net.SocketInputStream.read(SocketInputStream.java:101) at org.apache.derby.impl.drda.NetworkServerControlImpl.fillReplyBuffer(NetworkServerControlImpl.java:2809) at org.apache.derby.impl.drda.NetworkServerControlImpl.readResult(NetworkServerControlImpl.java:2753) at org.apache.derby.impl.drda.NetworkServerControlImpl.pingWithNoOpen(NetworkServerControlImpl.java:1214) at org.apache.derby.impl.drda.NetworkServerControlImpl.ping(NetworkServerControlImpl.java:1189) at org.apache.derby.drda.NetworkServerControl.ping(NetworkServerControl.java:395) at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.ping(ReplicationRun.java:2632) at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.pingServer(ReplicationRun.java:26 19) at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.startServer(ReplicationRun.java:2 291) at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun_Local_3_p5.testReplication_Local_ 3_p5_DERBY_3878(ReplicationRun_Local_3_p5.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109) at org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationRun.runBare(ReplicationRun.java:207) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:103) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.extensions.TestSetup.run(TestSetup.java:16) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.textui.TestRunner.doRun(TestRunner.java:116) at junit.textui.TestRunner.start(TestRunner.java:172) at junit.textui.TestRunner.main(TestRunner.java:138)
        Hide
        Kathey Marsden added a comment -

        I noticed the exception printed to the console has happened before in the nightlies for this test, e.g.
        http://people.apache.org/~myrnavl/derby_test_results/main/windows/testlog/ibm16/902522-suites.All_diff.txt
        The test actually prints out the stack trace and then creates and throws a new exception if the start time expires and this is the only place I see it printing out an exception. I don't understand though why the test would not fail if this happened. This is the relevant code from ReplicationRun

        String msg = "Could not ping in "
        + iterations + " * " + PINGSERVER_SLEEP_TIME_MILLIS + "ms.: "
        + finalException.getMessage();
        util.DEBUG( msg );
        finalException.printStackTrace(); // REMOVE?
        throw new Exception(msg);

        In the attached patch I changed this code to just throw finalException instead of creating a new exception and verified the test does fail with a setting of derby.tests.networkServerStartTimeout=500 and doesn't with it set to 5000 on my machine.

        I'll do one more full test run and then check in this change.

        Thanks

        Kathey

        Show
        Kathey Marsden added a comment - I noticed the exception printed to the console has happened before in the nightlies for this test, e.g. http://people.apache.org/~myrnavl/derby_test_results/main/windows/testlog/ibm16/902522-suites.All_diff.txt The test actually prints out the stack trace and then creates and throws a new exception if the start time expires and this is the only place I see it printing out an exception. I don't understand though why the test would not fail if this happened. This is the relevant code from ReplicationRun String msg = "Could not ping in " + iterations + " * " + PINGSERVER_SLEEP_TIME_MILLIS + "ms.: " + finalException.getMessage(); util.DEBUG( msg ); finalException.printStackTrace(); // REMOVE? throw new Exception(msg); In the attached patch I changed this code to just throw finalException instead of creating a new exception and verified the test does fail with a setting of derby.tests.networkServerStartTimeout=500 and doesn't with it set to 5000 on my machine. I'll do one more full test run and then check in this change. Thanks Kathey
        Hide
        Kathey Marsden added a comment -

        Myrna pointed out that this property should be seconds and not milliseconds. I'll need to rework the replication fix. Thanks Myrna for catching this.

        Show
        Kathey Marsden added a comment - Myrna pointed out that this property should be seconds and not milliseconds. I'll need to rework the replication fix. Thanks Myrna for catching this.
        Hide
        Kathey Marsden added a comment -

        Here is the updated patch that uses seconds and not milliseconds.

        Show
        Kathey Marsden added a comment - Here is the updated patch that uses seconds and not milliseconds.
        Hide
        Kathey Marsden added a comment -

        won't go back further than 10.5 for now

        Show
        Kathey Marsden added a comment - won't go back further than 10.5 for now
        Hide
        Kathey Marsden added a comment -

        I noticed a typo in the check in comment backport of part of revision 921028. I fixed the comment but am not sure if it will show up
        in subversion commits. The check in was the revision below:

        r921211 | kmarsden | 2010-03-09 18:35:46 -0800 (Tue, 09 Mar 2010) | 5 lines

        DERBY -4564 Replication tests do not pick up derby.tests.networkServerStartTimeo
        ut setting

        fix replication tests to use property as seconds, not milliseconds.

        Show
        Kathey Marsden added a comment - I noticed a typo in the check in comment backport of part of revision 921028. I fixed the comment but am not sure if it will show up in subversion commits. The check in was the revision below: r921211 | kmarsden | 2010-03-09 18:35:46 -0800 (Tue, 09 Mar 2010) | 5 lines DERBY -4564 Replication tests do not pick up derby.tests.networkServerStartTimeo ut setting fix replication tests to use property as seconds, not milliseconds.

          People

          • Assignee:
            Kathey Marsden
            Reporter:
            Kathey Marsden
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development