Dan Haywood created ISIS-1508:
---------------------------------
Summary: The integration test framework should be more resilient
to badly behaved tests that leave the transaction incomplete
Key: ISIS-1508
URL: https://issues.apache.org/jira/browse/ISIS-1508
Project: Isis
Issue Type: Improvement
Components: Core
Affects Versions: 1.13.0
Reporter: Dan Haywood
Assignee: Dan Haywood
Priority: Minor
Fix For: 1.13.1
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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)