diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseWebsocketApiTest.java b/application/src/test/java/org/thingsboard/server/controller/BaseWebsocketApiTest.java index fee52548d3..fb4d0320d7 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseWebsocketApiTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/BaseWebsocketApiTest.java @@ -445,6 +445,7 @@ public class BaseWebsocketApiTest extends AbstractWebsocketTest { wsClient.send(mapper.writeValueAsString(wrapper)); String msg = wsClient.waitForReply(); + Assert.assertNotNull(msg); EntityDataUpdate update = mapper.readValue(msg, EntityDataUpdate.class); Assert.assertEquals(1, update.getCmdId()); PageData pageData = update.getData(); @@ -457,13 +458,14 @@ public class BaseWebsocketApiTest extends AbstractWebsocketTest { wsClient.registerWaitForUpdate(); - Thread.sleep(100); + Thread.sleep(500); AttributeKvEntry dataPoint1 = new BaseAttributeKvEntry(now - TimeUnit.MINUTES.toMillis(1), new LongDataEntry("serverAttributeKey", 42L)); List tsData = Arrays.asList(dataPoint1); sendAttributes(device, TbAttributeSubscriptionScope.SERVER_SCOPE, tsData); msg = wsClient.waitForUpdate(); + Assert.assertNotNull(msg); update = mapper.readValue(msg, EntityDataUpdate.class); Assert.assertEquals(1, update.getCmdId()); @@ -479,9 +481,10 @@ public class BaseWebsocketApiTest extends AbstractWebsocketTest { AttributeKvEntry dataPoint2 = new BaseAttributeKvEntry(now, new LongDataEntry("serverAttributeKey", 52L)); wsClient.registerWaitForUpdate(); - Thread.sleep(100); + Thread.sleep(500); sendAttributes(device, TbAttributeSubscriptionScope.SERVER_SCOPE, Arrays.asList(dataPoint2)); msg = wsClient.waitForUpdate(); + Assert.assertNotNull(msg); update = mapper.readValue(msg, EntityDataUpdate.class); Assert.assertEquals(1, update.getCmdId()); @@ -495,14 +498,14 @@ public class BaseWebsocketApiTest extends AbstractWebsocketTest { //Sending update from the past, while latest value has new timestamp; wsClient.registerWaitForUpdate(); - Thread.sleep(100); + Thread.sleep(500); sendAttributes(device, TbAttributeSubscriptionScope.SERVER_SCOPE, Arrays.asList(dataPoint1)); msg = wsClient.waitForUpdate(TimeUnit.SECONDS.toMillis(1)); Assert.assertNull(msg); //Sending duplicate update again wsClient.registerWaitForUpdate(); - Thread.sleep(100); + Thread.sleep(500); sendAttributes(device, TbAttributeSubscriptionScope.SERVER_SCOPE, Arrays.asList(dataPoint2)); msg = wsClient.waitForUpdate(TimeUnit.SECONDS.toMillis(1)); Assert.assertNull(msg);