[jboss-dev-forums] [Design of JCA on JBoss] - TxConnectionManagerStressCase
adrian@jboss.org
do-not-reply at jboss.com
Thu Nov 27 10:34:44 EST 2008
This test keeps failing randomly.
I'm not entirely sure what this is actually trying to test,
it appears to be only failing if the tx timeout doesn't occur?
| // Only code that sets failed = true
|
| Transaction tx = tm.getTransaction();
| if (tx != null && TxUtils.isActive(tx))
| failed = true;
|
| // Other places that trap an error but don't set failed
|
| catch (ResourceException re)
| {
| error = re;
| log.info(re.getMessage(), re);
| }
|
| // Test only fails if failed is set (which isn't thread safe anyway!)
| assertTrue("Error in timeout test: " + error, !failed);
|
Anyway the reason why it is failing randomly is because giving only 500ms
for 100 threads to have their transactions timed out isn't going to work
if the server where the test is running is busy doing something else with its cpu.
I'm going to fix this test so that instead of using a Thread.wait()
it registers a transaction synchronization to do a more predicatble handoff
between the transaction timeout and whatever the test is trying to do.
While I'm there I'm going to fix the test so that it tidies up the thread transaction
association. The only reason that isn't an issue currently is because
each thread only goes through one iteration.
I'll leave it to you Jesper to figure out whether this test is actually testing what
it is supposed to be testing. ;-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192811#4192811
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192811
More information about the jboss-dev-forums
mailing list