NO-JIRA fix intermittently failing MQTT test

This commit is contained in:
Justin Bertram 2017-08-21 09:46:04 -05:00 committed by Clebert Suconic
parent 3d89a5eb21
commit e82f611e2e
1 changed files with 2 additions and 1 deletions

View File

@ -99,7 +99,8 @@ public class MQTTTest extends MQTTTestSupport {
mqtt.setVersion(version); mqtt.setVersion(version);
connection = mqtt.blockingConnection(); connection = mqtt.blockingConnection();
connection.connect(); connection.connect();
assertTrue(connection.isConnected()); BlockingConnection finalConnection = connection;
assertTrue("Should be connected", Wait.waitFor(() -> finalConnection.isConnected(), 5000, 100));
} finally { } finally {
if (connection != null && connection.isConnected()) connection.disconnect(); if (connection != null && connection.isConnected()) connection.disconnect();
} }