Derby
  1. Derby
  2. DERBY-3054

lang/synonym.sql fails with weme 6.1 with junit.framework.ComparisonFailure: Output at line 383 expected:<...1...> but was:<...2...>

    Details

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

      Description

      synonym(org.apache.derbyTesting.functionTests.tests.lang.LangScripts) failed:
      junit.framework.ComparisonFailure: Output at line 383 expected:<...1...> but was:<...2...>
      at junit.framework.Assert.assertEquals(Assert.java:81)
      at org.apache.derbyTesting.functionTests.util.CanonTestCase.compareCanon(CanonTestCase.java:100)
      at org.apache.derbyTesting.functionTests.util.ScriptTestCase.runTest(ScriptTestCase.java:124)
      at junit.framework.TestCase.runBare(TestCase.java:127)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:95)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      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:23)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      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.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.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at TimeRunner.main(TimeRunner.java:31)

        Activity

        Hide
        A B added a comment -

        Looks like this was not just a one-time failure. I've seen this test fail with weme6.1 twice in the last week. The lines of input in question are:

        ERROR X0Y23: Operation 'DROP SYNONYM' cannot be performed on
        object 'MYSYN' because VIEW 'V1' is dependent on that object.

        ERROR X0Y23: Operation 'DROP SYNONYM' cannot be performed on
        object 'MYSYN' because VIEW 'V2' is dependent on that object.

        Looks like the order of the two error messages is perhaps not guaranteed, so the "V2" message is sometimes printed before the "V1" message...is that a possibility? And if so, what's the best to way avoid this failure?

        Show
        A B added a comment - Looks like this was not just a one-time failure. I've seen this test fail with weme6.1 twice in the last week. The lines of input in question are: ERROR X0Y23: Operation 'DROP SYNONYM' cannot be performed on object 'MYSYN' because VIEW 'V1' is dependent on that object. ERROR X0Y23: Operation 'DROP SYNONYM' cannot be performed on object 'MYSYN' because VIEW 'V2' is dependent on that object. Looks like the order of the two error messages is perhaps not guaranteed, so the "V2" message is sometimes printed before the "V1" message...is that a possibility? And if so, what's the best to way avoid this failure?
        Hide
        Knut Anders Hatlen added a comment -

        > what's the best to way avoid this failure?

        Make the test assertion based?

        Show
        Knut Anders Hatlen added a comment - > what's the best to way avoid this failure? Make the test assertion based?
        Hide
        Mike Matrigali added a comment -

        I think converting at least the problem part of this test to be assertion based would best approach. The order of the dependent objects is likely jvm dependent, my guess is on some hash table used to store them and then scan through them in a jvm specific order. The order of the messages doesn't really matter just that an error is encountered when trying this particular operation.

        Show
        Mike Matrigali added a comment - I think converting at least the problem part of this test to be assertion based would best approach. The order of the dependent objects is likely jvm dependent, my guess is on some hash table used to store them and then scan through them in a jvm specific order. The order of the messages doesn't really matter just that an error is encountered when trying this particular operation.
        Hide
        Mamta A. Satoor added a comment -

        I have fixed this in main with revision 587553. Commit comments are as follows

        DERBY-3054

        The non-junit test, synonym.sql, tests the synonym dependency. The particular test case 2 views dependent on it.
        Depending on the jvm being used, the 2 exceptions(with same sql state but different object dependency in the sql
        message text) thrown for dependency might be in different order and that causes test failure. In order to fix this,
        I have carved out that test from synonym.sql into a new junit test and since in junit test, we can simply assert
        the sql state, the order of 2 exceptions does not matter. I will migrate this fix into Derby 10.3 soon.

        Show
        Mamta A. Satoor added a comment - I have fixed this in main with revision 587553. Commit comments are as follows DERBY-3054 The non-junit test, synonym.sql, tests the synonym dependency. The particular test case 2 views dependent on it. Depending on the jvm being used, the 2 exceptions(with same sql state but different object dependency in the sql message text) thrown for dependency might be in different order and that causes test failure. In order to fix this, I have carved out that test from synonym.sql into a new junit test and since in junit test, we can simply assert the sql state, the order of 2 exceptions does not matter. I will migrate this fix into Derby 10.3 soon.
        Hide
        Mamta A. Satoor added a comment -

        Merged changes into 10.3 with revision 587644.

        Show
        Mamta A. Satoor added a comment - Merged changes into 10.3 with revision 587644.

          People

          • Assignee:
            Mamta A. Satoor
            Reporter:
            Kathey Marsden
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development