NO-JIRA Fixing intermittent failure on JMSTransactionTest
We can't block the netty thread (which is used by the Listener) otherwise everything just blocks and nothing works on the client
This commit is contained in:
parent
4924bd6b81
commit
ef67ea0e26
|
@ -33,6 +33,7 @@ import javax.jms.MessageProducer;
|
|||
import javax.jms.Session;
|
||||
import javax.jms.TextMessage;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class JMSTransactionTest extends JMSTestBase {
|
||||
|
@ -70,7 +71,7 @@ public class JMSTransactionTest extends JMSTestBase {
|
|||
@Override
|
||||
public void onCompletion(Message message) {
|
||||
try {
|
||||
commitLatch.await();
|
||||
commitLatch.await(100, TimeUnit.MILLISECONDS); // can't block the netty thread. We will delay things, but can't block it otherwise the test just blocks
|
||||
sentMessages.incrementAndGet();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
Loading…
Reference in New Issue