genericconnector icon indicating copy to clipboard operation
genericconnector copied to clipboard

Random Failures in GenericResourceAdapterTest - Threading Issue?

Open CowboyJim opened this issue 7 years ago • 0 comments

Hi Ant. Great project, I have learned a lot from it!

I have seen a random issue while running the GenericResourceAdapterTest unit test which looks threading related. You can reproduce it by running the unit test over and over again. It appears to be related to threading since it is, well random, and you have random sleep time in your run method. I have included a few snippets from a typical stack trace below. Any ideas why or hints on where to look? Thanks

SEVERE: Failed to COMMIT
java.lang.Exception: test failure
	at ch.maxant.generic_jca_adapter.GenericResourceAdapterTest$12.commit(GenericResourceAdapterTest.java:586)
	at ch.maxant.generic_jca_adapter.TransactionAssistanceXAResource$1.commit(TransactionAssistanceXAResource.java:68)
	at ch.maxant.generic_jca_adapter.AbstractTransactionAssistanceXAResource.commit(AbstractTransactionAssistanceXAResource.java:76)
	at ch.maxant.generic_jca_adapter.TransactionAssistanceXAResource.commit(TransactionAssistanceXAResource.java:30)
	at ch.maxant.generic_jca_adapter.MiniContainer.finishTx(MiniContainer.java:166)
	at ch.maxant.generic_jca_adapter.MiniContainer.finishTransaction(MiniContainer.java:135)
	at ch.maxant.generic_jca_adapter.GenericResourceAdapterTest.testInContainer_CommitFailureHandledLaterInRecovery(GenericResourceAdapterTest.java:439)

^^^^^^^^^^^^^^ further up the stack trace

Tests run: 12, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.7 sec <<< FAILURE!
testInContainer_Multithreadedness(ch.maxant.generic_jca_adapter.GenericResourceAdapterTest)  Time elapsed: 0.566 sec  <<< FAILURE!
java.lang.AssertionError: expected:<250> but was:<249>
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.failNotEquals(Assert.java:743)
	at org.junit.Assert.assertEquals(Assert.java:118)
	at org.junit.Assert.assertEquals(Assert.java:555)
	at org.junit.Assert.assertEquals(Assert.java:542)
	at ch.maxant.generic_jca_adapter.GenericResourceAdapterTest.testInContainer_Multithreadedness(GenericResourceAdapterTest.java:570)

CowboyJim avatar Dec 09 '17 23:12 CowboyJim