Derby
  1. Derby
  2. DERBY-6039

Intermittent failure in LangProcedureTest.testDynamicResultSets: Table/View 'T1' does not exist.

    Details

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

      Description

      Seen in the nightly testing: http://download.java.net/javadesktop/derby/javadb-5570895-report/javadb-5570895-3573406-details.html

      testDynamicResultSets() needs the table T1, which is created by testSqlProcedures(). If testDynamicResultSets() happens to run before testSqlProcedures(), it will fail because T1 does not exist.

      1. d6039-2a.diff
        2 kB
        Knut Anders Hatlen
      2. d6039-1a.diff
        2 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        The attached patch makes testSqlProcedures() drop T1 when it's done, and testDynamicResultSets() recreates it. The test now passes regardless of how the two test cases are ordered.

        Show
        Knut Anders Hatlen added a comment - The attached patch makes testSqlProcedures() drop T1 when it's done, and testDynamicResultSets() recreates it. The test now passes regardless of how the two test cases are ordered.
        Hide
        Dag H. Wanvik added a comment -

        Thanks, Knut. Looks good. +1

        Do you think there could be other ordering bugs in this test? I presume it hasn't been run much with Java 7 yet. Maybe we should considering fixing the execution order of the fixtures?

        Show
        Dag H. Wanvik added a comment - Thanks, Knut. Looks good. +1 Do you think there could be other ordering bugs in this test? I presume it hasn't been run much with Java 7 yet. Maybe we should considering fixing the execution order of the fixtures?
        Hide
        Knut Anders Hatlen added a comment -

        Thanks for looking at the patch, Dag. Committed revision 1431948.

        I have no reason to believe there are other ordering bugs, so I don't think we need to change it to run with fixed execution order now. However, I added some code to the tearDown() method to print the names of all tables, procedures and function that live in the APP schema after each test case has completed, and found that testDuplicates() leaves a procedure called PROCDUP and testDynamicResultSets() leaves one called INSERTCAUSINGROLLBACK. If other test cases depend on the existence of those procedures, ordering may affect the result. I don't know if there are such dependencies, but I think we should make the two test cases clean up after themselves in any case. I'll post a follow-up patch.

        Show
        Knut Anders Hatlen added a comment - Thanks for looking at the patch, Dag. Committed revision 1431948. I have no reason to believe there are other ordering bugs, so I don't think we need to change it to run with fixed execution order now. However, I added some code to the tearDown() method to print the names of all tables, procedures and function that live in the APP schema after each test case has completed, and found that testDuplicates() leaves a procedure called PROCDUP and testDynamicResultSets() leaves one called INSERTCAUSINGROLLBACK. If other test cases depend on the existence of those procedures, ordering may affect the result. I don't know if there are such dependencies, but I think we should make the two test cases clean up after themselves in any case. I'll post a follow-up patch.
        Hide
        Knut Anders Hatlen added a comment -

        There was also a schema WAY created by testDynamicResultSets() and not dropped.

        The attached patch (d6039-2a.diff) makes the test cases drop all procedures, functions and schemas they have created.

        Committed revision 1431961.

        Show
        Knut Anders Hatlen added a comment - There was also a schema WAY created by testDynamicResultSets() and not dropped. The attached patch (d6039-2a.diff) makes the test cases drop all procedures, functions and schemas they have created. Committed revision 1431961.
        Hide
        Dag H. Wanvik added a comment -

        Thanks for cleaning this up, Knut! Hopefully this test will now run cleanly going forward

        Show
        Dag H. Wanvik added a comment - Thanks for cleaning this up, Knut! Hopefully this test will now run cleanly going forward

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development