File tree Expand file tree Collapse file tree
org.eclipse.paho.client.mqttv3.test/src/test/java/org/eclipse/paho/client/mqttv3/test Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -335,6 +335,7 @@ public void test330() throws Exception {
335335 String methodName = Utility .getMethodName ();
336336 LoggingUtilities .banner (log , cclass , methodName );
337337
338+ int before_thread_count = Thread .activeCount ();
338339 URI uri = new URI ("tcp://iot.eclipse.org:1882" );
339340 IMqttAsyncClient client = clientFactory .createMqttAsyncClient (uri , "client-1" );
340341
@@ -353,6 +354,17 @@ public void test330() throws Exception {
353354 } finally {
354355 client .close ();
355356 }
357+
358+ int after_count = Thread .activeCount ();
359+ Thread [] tarray = new Thread [after_count ];
360+ while (after_count > before_thread_count ) {
361+ after_count = Thread .enumerate (tarray );
362+ for (int i = 0 ; i < after_count ; ++i ) {
363+ log .info (i + " " + tarray [i ].getName ());
364+ }
365+ Thread .sleep (100 );
366+ }
367+ Assert .assertEquals (before_thread_count , after_count );
356368 }
357369
358370
@@ -465,7 +477,7 @@ public void test402a() throws Exception {
465477 for (int i = 0 ; i < after_count ; ++i ) {
466478 log .info (i + " " + tarray [i ].getName ());
467479 }
468- Assert .assertEquals (before_thread_count , after_count - pool_size );
480+ Assert .assertEquals (after_count , before_thread_count + pool_size );
469481 }
470482
471483
You can’t perform that action at this time.
0 commit comments