Derby
  1. Derby
  2. DERBY-5101

TruncateTableTest 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 for example the test case testSelfReferencing in TruncateTableTest runs before the other test cases, the test will fail like this:

      2) testSelfReferencing(org.apache.derbyTesting.functionTests.tests.lang.TruncateTableTest)java.sql.SQLSyntaxErrorException: Schema 'ALICE' does not exist
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:92)
      at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:256)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:396)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:348)
      at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2290)
      at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
      at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:619)
      at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:559)
      at org.apache.derbyTesting.functionTests.tests.lang.TruncateTableTest.testSelfReferencing(TruncateTableTest.java:167)

      The test should either make the order of the test cases explicit or make the test cases independent of the order in which they run.

      1. derby-5101-1a.diff
        1 kB
        Knut Anders Hatlen

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          8d 20h 14m 1 Knut Anders Hatlen 17/Mar/11 08:45
          In Progress In Progress Resolved Resolved
          9m 4s 1 Knut Anders Hatlen 17/Mar/11 08:54
          Resolved Resolved Closed Closed
          105d 27m 1 Knut Anders Hatlen 30/Jun/11 10:21
          Gavin made changes -
          Workflow jira [ 12601031 ] Default workflow, editable Closed status [ 12801121 ]
          Knut Anders Hatlen made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          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 ]
          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 ]
          Knut Anders Hatlen made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Fix Version/s 10.8.0.0 [ 12315561 ]
          Resolution Fixed [ 1 ]
          Hide
          Knut Anders Hatlen added a comment -

          Committed revision 1082428.

          Show
          Knut Anders Hatlen added a comment - Committed revision 1082428.
          Knut Anders Hatlen made changes -
          Attachment derby-5101-1a.diff [ 12473887 ]
          Hide
          Knut Anders Hatlen added a comment -

          The problem is caused by DERBY-5139. When creating a self-referencing table, the user schema isn't automatically created. So when testSelfReferencing happens to run first, the schema isn't created, and the test fails.

          I've added a workaround (create the ALICE schema if it doesn't already exist) and added a comment pointing to DERBY-5139. This makes the test run cleanly also in the case where testSelfReferencing runs first. We should remove the workaround when DERBY-5139 has been fixed.

          Show
          Knut Anders Hatlen added a comment - The problem is caused by DERBY-5139 . When creating a self-referencing table, the user schema isn't automatically created. So when testSelfReferencing happens to run first, the schema isn't created, and the test fails. I've added a workaround (create the ALICE schema if it doesn't already exist) and added a comment pointing to DERBY-5139 . This makes the test run cleanly also in the case where testSelfReferencing runs first. We should remove the workaround when DERBY-5139 has been fixed.
          Knut Anders Hatlen made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Knut Anders Hatlen made changes -
          Assignee Knut Anders Hatlen [ knutanders ]
          Knut Anders Hatlen made changes -
          Field Original Value New Value
          Link This issue relates to DERBY-5139 [ DERBY-5139 ]
          Show
          Knut Anders Hatlen added a comment - Also seen in the nightly regression tests: http://dbtg.foundry.sun.com/derby/test/Daily/jvm1.7/testing/testlog/sol32/1078855-suitesAll_diff.txt
          Knut Anders Hatlen created issue -

            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