Skip to content

Commit e3d0055

Browse files
committed
Adding extra log message to CommsReceiver & timeouts to all tests to improve test failure debug
Signed-off-by: James Sutton <james.sutton@uk.ibm.com>
1 parent b1aca23 commit e3d0055

16 files changed

Lines changed: 55 additions & 46 deletions

File tree

org.eclipse.paho.client.mqttv3.test/src/test/java/org/eclipse/paho/client/mqttv3/test/BasicSSLTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public static void tearDownAfterClass() throws Exception {
9797
* An ssl connection with server cert authentication, simple pub/sub
9898
* @throws Exception
9999
*/
100-
@Test
100+
@Test(timeout=10000)
101101
public void testSSL() throws Exception {
102102
URI serverURI = new URI("ssl://" + serverHost + ":" + TestProperties.getServerSSLPort());
103103
String methodName = Utility.getMethodName();
@@ -160,7 +160,7 @@ public void testSSL() throws Exception {
160160
* An ssl connection with server cert authentication, small workload with multiple clients
161161
* @throws Exception
162162
*/
163-
@Test
163+
@Test(timeout=60000)
164164
public void testSSLWorkload() throws Exception {
165165
URI serverURI = new URI("ssl://" + serverHost + ":" + TestProperties.getServerSSLPort());
166166
String methodName = Utility.getMethodName();
@@ -256,7 +256,7 @@ public void testSSLWorkload() throws Exception {
256256
* 'messageSize' defined at start of test, change it to meet your requirements
257257
* @throws Exception
258258
*/
259-
@Test
259+
@Test(timeout=10000)
260260
public void testSSLLargeMessage() throws Exception {
261261
URI serverURI = new URI("ssl://" + serverHost + ":" + TestProperties.getServerSSLPort());
262262
String methodName = Utility.getMethodName();
@@ -322,7 +322,7 @@ public void testSSLLargeMessage() throws Exception {
322322
* A non ssl connection to an ssl channel
323323
* @throws Exception
324324
*/
325-
@Test
325+
@Test(timeout=10000)
326326
public void testNonSSLtoSSLChannel() throws Exception {
327327
String methodName = Utility.getMethodName();
328328
LoggingUtilities.banner(log, cclass, methodName);
@@ -372,7 +372,7 @@ public void testNonSSLtoSSLChannel() throws Exception {
372372
* Try ssl connection to channel without ssl
373373
* @throws Exception
374374
*/
375-
@Test
375+
@Test(timeout=30000)
376376
public void testSSLtoNonSSLChannel() throws Exception {
377377
String methodName = Utility.getMethodName();
378378
LoggingUtilities.banner(log, cclass, methodName);

org.eclipse.paho.client.mqttv3.test/src/test/java/org/eclipse/paho/client/mqttv3/test/BasicTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public static void tearDownAfterClass() throws Exception {
9595
/**
9696
* @throws Exception
9797
*/
98-
@Test
98+
@Test(timeout=10000)
9999
public void testConnect() throws Exception {
100100
String methodName = Utility.getMethodName();
101101
LoggingUtilities.banner(log, cclass, methodName);
@@ -141,7 +141,7 @@ public void testConnect() throws Exception {
141141
/**
142142
* @throws Exception
143143
*/
144-
@Test
144+
@Test(timeout=10000)
145145
public void testHAConnect() throws Exception {
146146
String methodName = Utility.getMethodName();
147147
LoggingUtilities.banner(log, cclass, methodName);
@@ -191,7 +191,7 @@ public void testHAConnect() throws Exception {
191191
/**
192192
* @throws Exception
193193
*/
194-
@Test
194+
@Test(timeout=10000)
195195
public void testPubSub() throws Exception {
196196
String methodName = Utility.getMethodName();
197197
LoggingUtilities.banner(log, cclass, methodName);
@@ -241,7 +241,7 @@ public void testPubSub() throws Exception {
241241
/**
242242
* @throws Exception
243243
*/
244-
@Test
244+
@Test(timeout=10000)
245245
public void testMsgProperties() throws Exception {
246246
String methodName = Utility.getMethodName();
247247
LoggingUtilities.banner(log, cclass, methodName);
@@ -309,7 +309,7 @@ public void testMsgProperties() throws Exception {
309309
/**
310310
* @throws Exception
311311
*/
312-
@Test
312+
@Test(timeout=10000)
313313
public void testConnOptDefaults() throws Exception {
314314
String methodName = Utility.getMethodName();
315315
LoggingUtilities.banner(log, cclass, methodName);

org.eclipse.paho.client.mqttv3.test/src/test/java/org/eclipse/paho/client/mqttv3/test/Bug443142Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static void setUpBeforeClass() throws Exception {
4646
}
4747
}
4848

49-
@Test
49+
@Test(timeout=30000)
5050
public void testBug443142() throws Exception {
5151
CountDownLatch stopLatch = new CountDownLatch(1);
5252
MqttClient client1 = new MqttClient(serverURI.toString(), "Bug443142Test-" + UUID.randomUUID().toString());

org.eclipse.paho.client.mqttv3.test/src/test/java/org/eclipse/paho/client/mqttv3/test/LiveTakeOverTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public static void tearDownAfterClass() throws Exception {
102102
* Test that a client actively doing work can be taken over
103103
* @throws Exception
104104
*/
105-
@Test
105+
@Test(timeout=10000)
106106
public void testLiveTakeOver() throws Exception {
107107
String methodName = Utility.getMethodName();
108108
LoggingUtilities.banner(log, cclass, methodName);

org.eclipse.paho.client.mqttv3.test/src/test/java/org/eclipse/paho/client/mqttv3/test/ModelTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public static void tearDownAfterClass() throws Exception {
167167
/**
168168
* @throws Exception
169169
*/
170-
@Test
170+
@Test(timeout=150000)
171171
public void testRunModel() throws Exception {
172172
log.info("Test core operations and parameters by random selection");
173173
log.info("See file: " + logFilename + " for details of selected test sequence");

org.eclipse.paho.client.mqttv3.test/src/test/java/org/eclipse/paho/client/mqttv3/test/PerSubscriptionMessageHandlerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public void messageArrived(String topic, MqttMessage message) throws Exception {
136136
*
137137
* @throws Exception
138138
*/
139-
@Test
139+
@Test(timeout=10000)
140140
public void testSyncSubs1() throws Exception {
141141
final String methodName = Utility.getMethodName();
142142
LoggingUtilities.banner(log, cclass, methodName);
@@ -166,7 +166,7 @@ public void testSyncSubs1() throws Exception {
166166

167167
}
168168

169-
@Test
169+
@Test(timeout=10000)
170170
public void testAsyncSubs1() throws Exception {
171171
final String methodName = Utility.getMethodName();
172172
LoggingUtilities.banner(log, cclass, methodName);
@@ -204,7 +204,7 @@ public void testAsyncSubs1() throws Exception {
204204
* Check handlers still exist after reconnection non-cleansession
205205
*/
206206

207-
@Test
207+
@Test(timeout=10000)
208208
public void testSyncCleanSessionFalse() throws Exception {
209209
final String methodName = Utility.getMethodName();
210210
LoggingUtilities.banner(log, cclass, methodName);
@@ -256,7 +256,7 @@ public void testSyncCleanSessionFalse() throws Exception {
256256
mqttClient.close();
257257
}
258258

259-
@Test
259+
@Test(timeout=10000)
260260
public void testAsyncCleanSessionFalse() throws Exception {
261261
final String methodName = Utility.getMethodName();
262262
LoggingUtilities.banner(log, cclass, methodName);

org.eclipse.paho.client.mqttv3.test/src/test/java/org/eclipse/paho/client/mqttv3/test/SSLSessionResumptionTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public static void setUpBeforeClass() throws Exception {
7878
*
7979
* @throws Exception
8080
*/
81-
@Test
81+
@Test(timeout=30000)
8282
public void testSSLSessionInvalidated() throws Exception {
8383
// System.setProperty("javax.net.debug", "all");
8484

@@ -120,7 +120,7 @@ public void testSSLSessionInvalidated() throws Exception {
120120
*
121121
* @throws Exception
122122
*/
123-
@Test
123+
@Test(timeout=10000)
124124
public void testSSLSessionCached() throws Exception {
125125
// System.setProperty("javax.net.debug", "all");
126126

org.eclipse.paho.client.mqttv3.test/src/test/java/org/eclipse/paho/client/mqttv3/test/SendReceiveAsyncCallbackTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ public void onFailure(IMqttToken asyncActionToken, Throwable exception) {
295295
*
296296
* @throws Exception
297297
*/
298-
@Test
298+
@Test(timeout=10000)
299299
public void test1() throws Exception {
300300
final String methodName = Utility.getMethodName();
301301
LoggingUtilities.banner(log, cclass, methodName);

org.eclipse.paho.client.mqttv3.test/src/test/java/org/eclipse/paho/client/mqttv3/test/SendReceiveAsyncTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public static void tearDownAfterClass() throws Exception {
9595
*
9696
* @throws Exception
9797
*/
98-
@Test
98+
@Test(timeout=10000)
9999
public void testConnect() throws Exception {
100100
final String methodName = Utility.getMethodName();
101101
LoggingUtilities.banner(log, cclass, methodName);
@@ -142,7 +142,7 @@ public void testConnect() throws Exception {
142142
*
143143
* @throws Exception
144144
*/
145-
@Test
145+
@Test(timeout=10000)
146146
public void testRemoteConnect() throws Exception {
147147
final String methodName = Utility.getMethodName();
148148
LoggingUtilities.banner(log, cclass, methodName);
@@ -214,7 +214,7 @@ public void testRemoteConnect() throws Exception {
214214
/**
215215
* Test client pubSub using very large messages
216216
*/
217-
@Test
217+
@Test(timeout=10000)
218218
public void testLargeMessage() {
219219
final String methodName = Utility.getMethodName();
220220
LoggingUtilities.banner(log, cclass, methodName);
@@ -291,7 +291,7 @@ public void testLargeMessage() {
291291
/**
292292
* Multiple publishers and subscribers.
293293
*/
294-
@Test
294+
@Test(timeout=20000)
295295
public void testMultipleClients() {
296296
final String methodName = Utility.getMethodName();
297297
LoggingUtilities.banner(log, cclass, methodName);
@@ -386,7 +386,7 @@ public void testMultipleClients() {
386386
* Test the behaviour of the cleanStart flag, used to clean up before
387387
* re-connecting.
388388
*/
389-
@Test
389+
@Test(timeout=10000)
390390
public void testCleanStart() throws Exception {
391391
final String methodName = Utility.getMethodName();
392392
LoggingUtilities.banner(log, cclass, methodName);
@@ -532,7 +532,7 @@ public void testCleanStart() throws Exception {
532532
*
533533
* Since no other activity (messages from the client to the broker) is generated, the broker disconnects the client.
534534
*/
535-
@Test
535+
@Test(timeout=300000)
536536
public void testVeryLargeMessageWithShortKeepAlive() {
537537
final String methodName = Utility.getMethodName();
538538
LoggingUtilities.banner(log, cclass, methodName);
@@ -601,7 +601,7 @@ public void testVeryLargeMessageWithShortKeepAlive() {
601601
* Test the behavior of the connection timeout when connecting to a non MQTT server.
602602
* i.e. ssh port 22
603603
*/
604-
@Test
604+
@Test(timeout=60000)
605605
public void testConnectTimeout() throws Exception {
606606
final String methodName = Utility.getMethodName();
607607
LoggingUtilities.banner(log, cclass, methodName);

org.eclipse.paho.client.mqttv3.test/src/test/java/org/eclipse/paho/client/mqttv3/test/SendReceiveTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public static void tearDownAfterClass() throws Exception {
9393
* service
9494
* @throws Exception
9595
*/
96-
@Test
96+
@Test(timeout=10000)
9797
public void testConnect() throws Exception {
9898
final String methodName = Utility.getMethodName();
9999
LoggingUtilities.banner(log, cclass, methodName);
@@ -129,7 +129,7 @@ public void testConnect() throws Exception {
129129
* Test connection using a remote host name for the local host.
130130
* @throws Exception
131131
*/
132-
@Test
132+
@Test(timeout=10000)
133133
public void testRemoteConnect() throws Exception {
134134
final String methodName = Utility.getMethodName();
135135
LoggingUtilities.banner(log, cclass, methodName);
@@ -184,7 +184,7 @@ public void testRemoteConnect() throws Exception {
184184
/**
185185
* Test client pubSub using largish messages
186186
*/
187-
@Test
187+
@Test(timeout=10000)
188188
public void testLargeMessage() {
189189
final String methodName = Utility.getMethodName();
190190
LoggingUtilities.banner(log, cclass, methodName);
@@ -245,7 +245,7 @@ public void testLargeMessage() {
245245
/**
246246
* Test that QOS values are preserved between MQTT publishers and subscribers.
247247
*/
248-
@Test
248+
@Test(timeout=10000)
249249
public void testQoSPreserved() {
250250
final String methodName = Utility.getMethodName();
251251
LoggingUtilities.banner(log, cclass, methodName);
@@ -305,7 +305,7 @@ public void testQoSPreserved() {
305305
* Multiple publishers and subscribers.
306306
* @throws Exception
307307
*/
308-
@Test
308+
@Test(timeout=30000)
309309
public void testMultipleClients() throws Exception {
310310
final String methodName = Utility.getMethodName();
311311
LoggingUtilities.banner(log, cclass, methodName);
@@ -388,7 +388,7 @@ public void testMultipleClients() throws Exception {
388388
* Test the behaviour of the cleanStart flag, used to clean up before re-connecting.
389389
* @throws Exception
390390
*/
391-
@Test
391+
@Test(timeout=10000)
392392
public void testCleanStart() throws Exception {
393393
final String methodName = Utility.getMethodName();
394394
LoggingUtilities.banner(log, cclass, methodName);

0 commit comments

Comments
 (0)