Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
-
Patch Available
-
Unit Test Broken
Description
MQTTSSLTest has multiple different test cases (including testSendAndReceiveExactlyOnce, testSendAndReceiveLargeMessages, testSendAndReceiveMQTT, testSendAtLeastOnceReceiveAtMostOnce, testSendAtLeastOnceReceiveExactlyOnce, testSendJMSReceiveMQTT, testSendMQTTReceiveJMS) which fail fairly frequently because of a hang on the provider.connect() call in initializeConnection() as shown in the stacktrace below.
Another problem with this test is it was giving a misleading error when run under Hudson, showing that the test that followed it (MQTTTest) was failing instead. I think this was because of the way it was using AutoFailTestSupport. I will attach a patch which removes that and uses timeouts on @Test annotations instead.
testSendAndReceiveLargeMessages(org.apache.activemq.transport.mqtt.MQTTSSLTest) Time elapsed: 30.004 sec <<< ERROR!
java.lang.Exception: test timed out after 30000 milliseconds
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:994)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1303)
at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:236)
at org.fusesource.mqtt.client.Promise.await(Promise.java:88)
at org.fusesource.mqtt.client.BlockingConnection.connect(BlockingConnection.java:49)
at org.apache.activemq.transport.mqtt.FuseMQQTTClientProvider.connect(FuseMQQTTClientProvider.java:39)
at org.apache.activemq.transport.mqtt.MQTTSSLTest.initializeConnection(MQTTSSLTest.java:60)
Results :
Tests in error:
MQTTSSLTest>AbstractMQTTTest.testSendAndReceiveLargeMessages:247->initializeConnection:60 ยป