Derby
  1. Derby
  2. DERBY-4908

Instability in CheckConstraintTest.testBuiltInFunctions

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.7.1.1
    • Fix Version/s: 10.7.1.1, 10.8.1.2
    • Component/s: Test
    • Labels:
      None
    • Environment:
      java version "1.6.0_20"
      Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
      Oracle JRockit(R) (build R28.0.1-21-133393-1.6.0_20-20100512-2126-linux-ia32, compiled mode)
    • Bug behavior facts:
      Regression Test Failure

      Description

      Saw this failure once when running suites.All on the 10.7.1.0 release candidate:

      1) testBuiltInFunctions(org.apache.derbyTesting.functionTests.tests.lang.CheckConstraintTest)junit.framework.AssertionFailedError: Column value mismatch @ column 'TYPE', row 1:
      Expected: >P<
      Found: >U<
      at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1213)
      at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1125)
      at org.apache.derbyTesting.junit.JDBC.assertFullResultSetMinion(JDBC.java:1012)
      at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:935)
      at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:892)
      at org.apache.derbyTesting.functionTests.tests.lang.CheckConstraintTest.testBuiltInFunctions(CheckConstraintTest.java:752)

      The failure didn't show up when I reran the test (reran both standalone and as part of suites.All).

      1. assert-unordered.diff
        0.6 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        The attached patch switches from assertFullResultSet to assertUnorderedResultSet.

        Committed to trunk with revision 1036769.
        Committed to 10.7 with revision 1036771.

        Show
        Knut Anders Hatlen added a comment - The attached patch switches from assertFullResultSet to assertUnorderedResultSet. Committed to trunk with revision 1036769. Committed to 10.7 with revision 1036771.
        Hide
        Knut Anders Hatlen added a comment -

        The failing assert looks like this:

        rs = st.executeQuery(
        " select c.type from "
        + "sys.sysconstraints c, sys.systables t where "
        + "c.tableid = t.tableid and tablename='T1'");
        (...)
        expRS = new String [][]
        {

        {"P"}

        ,

        {"U"},
        {"C"},
        {"U"}

        ,

        {"C"}

        };

        JDBC.assertFullResultSet(rs, expRS, true);

        There's no ORDER BY clause in the query, so the failure may be caused by the the optimizer choosing a different plan for the execution. We should probably use assertUnorderedResultSet() instead of assertFullResultSet() when we check the results.

        Show
        Knut Anders Hatlen added a comment - The failing assert looks like this: rs = st.executeQuery( " select c.type from " + "sys.sysconstraints c, sys.systables t where " + "c.tableid = t.tableid and tablename='T1'"); (...) expRS = new String [][] { {"P"} , {"U"}, {"C"}, {"U"} , {"C"} }; JDBC.assertFullResultSet(rs, expRS, true); There's no ORDER BY clause in the query, so the failure may be caused by the the optimizer choosing a different plan for the execution. We should probably use assertUnorderedResultSet() instead of assertFullResultSet() when we check the results.

          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