Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-6561

Regression: MTTransactionManagerUnitTestCase.testCommitSameTxInTwoThreads() fails


      One of the TM tests in the AS fails due to what it perceives as a spec compliance failure. However, I am not sure the test is correct.

      The test starts a transaction using TransactionManager in thread 0 and then commits the transaction in thread 1. Thread 0 then calls tm.commit(), and it expects an IllegalStateException because the test does not think the transaction should be associated with Thread 0 at this point.

      The spec doesn't seem to say anything about Transaction.commit() causing other threads to unassociate themselves with the Transaction. Is the test wrong?

      ./build.sh -Dtest=org.jboss.test.tm.test.MTTransactionManagerUnitTestCase one-test

      Test failure:
      Caused by: java.lang.Exception: Expected throwable java.lang.IllegalStateException
      at org.jboss.test.tm.resource.MTOperation.perform(MTOperation.java:195)
      at org.jboss.test.tm.mbean2.MTTest$ExecTask.run(MTTest.java:106)

      17:51:47,571 INFO [MTTest] *** Starting test: testCommitSameTxInTwoThreads
      17:51:47,572 INFO [MTTest] Number of Threads: 2
      17:51:47,578 INFO [MTTest] Starting thread: Thread-23
      17:51:47,578 INFO [MTTest] Thread-23 TM_BEGIN (10)
      17:51:47,580 INFO [MTTest] Starting thread: Thread-24
      17:51:47,580 INFO [MTTest] Thread-24 XX_WAIT_FOR (10)
      17:51:47,580 INFO [MTTest] Thread-23 STATUS_ACTIVE
      17:51:47,580 INFO [MTTest] Thread-23 XX_SLEEP_200
      17:51:47,580 INFO [MTTest] Thread-24 Got it
      17:51:47,581 INFO [MTTest] Thread-24 TX_COMMIT (10)
      17:51:47,581 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_57] - Commit of action id -3f57fe9a:d655:49ac70e5:65 invoked while multiple threads active within it.
      17:51:47,581 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.CheckedAction_1] - CheckedAction::check - atomic action -3f57fe9a:d655:49ac70e5:65 commiting with 1 threads active!
      17:51:47,582 INFO [MTTest] Thread-24 STATUS_NO_TRANSACTION
      17:51:47,582 INFO [MTTest] Finished thread: Thread-24
      17:51:47,780 INFO [MTTest] Thread-23 STATUS_COMMITTED
      17:51:47,781 INFO [MTTest] Thread-23 TM_COMMIT
      17:51:47,781 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_34] - End called on already committed atomic action -3f57fe9a:d655:49ac70e5:65
      17:51:47,782 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_34] - End called on already committed atomic action -3f57fe9a:d655:49ac70e5:65
      17:51:47,782 INFO [MTTest] Finished thread: Thread-23
      17:51:47,783 INFO [MTTest] *** Finished test: testCommitSameTxInTwoThreads

            jgreene@redhat.com Jason Greene
            jgreene@redhat.com Jason Greene
            0 Vote for this issue
            0 Start watching this issue