Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-1508

The integration test framework should be more resilient to badly behaved tests that leave the transaction incomplete

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.13.0
    • Fix Version/s: 1.13.1
    • Component/s: Core
    • Labels:
      None

      Description

      Most notably, it's possible for a test to fail an assertion, meaning that the test method is exited, while there are still pending SQL statements to be flushed.

      The current clean up processing (in the IsisTransactionRule) just does a close session, and the first thing that does is close the current transaction if any, by (attempting to commit). However, if that commit in turn throws an exception, then remaining close tran/close session functionality is skipped. The net result is that the transaction is left incomplete (transactionLevel=1) with the currentTransaction in a state of MUST_ABORT.

      Every subsequent test, when it attempts to start its own transaction, immediately finds there's already a MUST_ABORT transaction in place, and fails immediately.

      The net effect is that, once one test has failed in this way, then all other tests in the test suite will also fail.

      The fix is just to do the clean up more robustly in IsisTransactionRule.

        Activity

        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit a5dfef8f8a29cb17845f7cf3a726cab5133773e4 in isis's branch refs/heads/master from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=a5dfef8 ]

        ISIS-1508: makes the clean up functionality within IsisTransactionRule (as used by integ tests) more robust to a badly behaving test.

        Show
        jira-bot ASF subversion and git services added a comment - Commit a5dfef8f8a29cb17845f7cf3a726cab5133773e4 in isis's branch refs/heads/master from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=a5dfef8 ] ISIS-1508 : makes the clean up functionality within IsisTransactionRule (as used by integ tests) more robust to a badly behaving test.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 89886e0c1743f66d625078200071928d1975e9a6 in isis's branch refs/heads/maint-1.13.1 from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=89886e0 ]

        ISIS-1508: makes the clean up functionality within IsisTransactionRule (as used by integ tests) more robust to a badly behaving test.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 89886e0c1743f66d625078200071928d1975e9a6 in isis's branch refs/heads/maint-1.13.1 from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=89886e0 ] ISIS-1508 : makes the clean up functionality within IsisTransactionRule (as used by integ tests) more robust to a badly behaving test.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 89886e0c1743f66d625078200071928d1975e9a6 in isis's branch refs/heads/master from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=89886e0 ]

        ISIS-1508: makes the clean up functionality within IsisTransactionRule (as used by integ tests) more robust to a badly behaving test.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 89886e0c1743f66d625078200071928d1975e9a6 in isis's branch refs/heads/master from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=89886e0 ] ISIS-1508 : makes the clean up functionality within IsisTransactionRule (as used by integ tests) more robust to a badly behaving test.

          People

          • Assignee:
            danhaywood Dan Haywood
            Reporter:
            danhaywood Dan Haywood
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development