Derby
  1. Derby
  2. DERBY-5115

NetworkServerControlApiTest depends on implicit ordering of test cases

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.8.1.2
    • Fix Version/s: 10.8.1.2
    • Component/s: Test
    • Labels:
      None
    • Bug behavior facts:
      Regression Test Failure

      Description

      If the test cases in NetworkServerControlApiTest run in a different order than the order in which they appear in the source file, they may fail. Seen in the nightly regression tests on Java 7, for example here:

      http://dbtg.foundry.sun.com/derby/test/Daily/jvm1.7/testing/testlog/lin/1078855-suitesAll_diff.txt

      1) testTraceCommands(org.apache.derbyTesting.functionTests.tests.derbynet.NetworkServerControlApiTest)junit.framework.AssertionFailedError
      at org.apache.derbyTesting.functionTests.tests.derbynet.NetworkServerControlApiTest.testTraceCommands(NetworkServerControlApiTest.java:116)
      ...
      2) testPropertiesAfterConnection(org.apache.derbyTesting.functionTests.tests.derbynet.GetCurrentPropertiesTest)junit.framework.ComparisonFailure: expected:<true> but was:<null>
      at org.apache.derbyTesting.functionTests.tests.derbynet.GetCurrentPropertiesTest.testPropertiesAfterConnection(GetCurrentPropertiesTest.java:170)

      The test should either make the order of the test cases explicit, or make the test cases independent of each other.

      1. derby-5115-1a.diff
        12 kB
        Knut Anders Hatlen

        Issue Links

          Activity

          Knut Anders Hatlen created issue -
          Hide
          Knut Anders Hatlen added a comment -

          The first assert failure mentioned in the bug description happens in code that looks like this:

          nsctrl.trace(true);
          nsctrl.ping();
          assertTrue(fileExists(derbySystemHome+"/Server3.trace"));
          nsctrl.trace(false);

          If other test cases run before testTraceCommands, the connection number used in the ping call may not be 3, and the assert fails.

          Show
          Knut Anders Hatlen added a comment - The first assert failure mentioned in the bug description happens in code that looks like this: nsctrl.trace(true); nsctrl.ping(); assertTrue(fileExists(derbySystemHome+"/Server3.trace")); nsctrl.trace(false); If other test cases run before testTraceCommands, the connection number used in the ping call may not be 3, and the assert fails.
          Knut Anders Hatlen made changes -
          Field Original Value New Value
          Assignee Knut Anders Hatlen [ knutanders ]
          Knut Anders Hatlen made changes -
          Link This issue relates to DERBY-5100 [ DERBY-5100 ]
          Knut Anders Hatlen made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          Knut Anders Hatlen added a comment -

          Attaching a patch that makes the ordering of the test cases explicit, using the helper method added in DERBY-5100. Also added a comment to the test explaining why a fixed ordering is needed. This makes the test stable in my environment.

          Show
          Knut Anders Hatlen added a comment - Attaching a patch that makes the ordering of the test cases explicit, using the helper method added in DERBY-5100 . Also added a comment to the test explaining why a fixed ordering is needed. This makes the test stable in my environment.
          Knut Anders Hatlen made changes -
          Attachment derby-5115-1a.diff [ 12473820 ]
          Hide
          Knut Anders Hatlen added a comment -

          Committed revision 1082233.

          Show
          Knut Anders Hatlen added a comment - Committed revision 1082233.
          Knut Anders Hatlen made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Fix Version/s 10.8.0.0 [ 12315561 ]
          Resolution Fixed [ 1 ]
          Rick Hillegas made changes -
          Affects Version/s 10.8.1.1 [ 12316356 ]
          Affects Version/s 10.8.1.0 [ 12315561 ]
          Fix Version/s 10.8.1.1 [ 12316356 ]
          Fix Version/s 10.8.1.0 [ 12315561 ]
          Rick Hillegas made changes -
          Affects Version/s 10.8.1.2 [ 12316362 ]
          Affects Version/s 10.8.1.1 [ 12316356 ]
          Fix Version/s 10.8.1.2 [ 12316362 ]
          Fix Version/s 10.8.1.1 [ 12316356 ]
          Knut Anders Hatlen made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Gavin made changes -
          Workflow jira [ 12601149 ] Default workflow, editable Closed status [ 12801117 ]

            People

            • Assignee:
              Knut Anders Hatlen
              Reporter:
              Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development