Browse Source
Merge pull request #15157 from smatvienko-tb/fix/sparkplug-flaky-test-device-not-found
Fix flaky Sparkplug connection test: handle 404 during device await
pull/15197/head
Viacheslav Klimov
3 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
5 additions and
0 deletions
-
application/src/test/java/org/thingsboard/server/transport/mqtt/mqttv3/attributes/AbstractMqttAttributesIntegrationTest.java
-
application/src/test/java/org/thingsboard/server/transport/mqtt/sparkplug/AbstractMqttV5ClientSparkplugTest.java
-
application/src/test/java/org/thingsboard/server/transport/mqtt/sparkplug/attributes/AbstractMqttV5ClientSparkplugAttributesTest.java
|
|
|
@ -420,6 +420,7 @@ public abstract class AbstractMqttAttributesIntegrationTest extends AbstractMqtt |
|
|
|
|
|
|
|
Awaitility.await() |
|
|
|
.atMost(10, TimeUnit.SECONDS) |
|
|
|
.ignoreExceptions() |
|
|
|
.until(() -> { |
|
|
|
List<Map<String, Object>> attributes = doGetAsyncTyped(attributeValuesUrl, new TypeReference<>() { |
|
|
|
}); |
|
|
|
|
|
|
|
@ -191,6 +191,7 @@ public abstract class AbstractMqttV5ClientSparkplugTest extends AbstractMqttInte |
|
|
|
AtomicReference<Device> device = new AtomicReference<>(); |
|
|
|
await(alias + "find device [" + deviceName + "] after created") |
|
|
|
.atMost(200, TimeUnit.SECONDS) |
|
|
|
.ignoreExceptions() |
|
|
|
.until(() -> { |
|
|
|
device.set(doGet("/api/tenant/devices?deviceName=" + deviceName, Device.class)); |
|
|
|
return device.get() != null; |
|
|
|
@ -236,6 +237,7 @@ public abstract class AbstractMqttV5ClientSparkplugTest extends AbstractMqttInte |
|
|
|
AtomicReference<Device> device = new AtomicReference<>(); |
|
|
|
await(alias + "find device [" + deviceName + "] after created") |
|
|
|
.atMost(200, TimeUnit.SECONDS) |
|
|
|
.ignoreExceptions() |
|
|
|
.until(() -> { |
|
|
|
device.set(doGet("/api/tenant/devices?deviceName=" + deviceName, Device.class)); |
|
|
|
return device.get() != null; |
|
|
|
|
|
|
|
@ -468,6 +468,7 @@ public abstract class AbstractMqttV5ClientSparkplugAttributesTest extends Abstra |
|
|
|
AtomicReference<List<String>> actualKeys = new AtomicReference<>(); |
|
|
|
await(alias + SparkplugMessageType.NBIRTH.name()) |
|
|
|
.atMost(40, TimeUnit.SECONDS) |
|
|
|
.ignoreExceptions() |
|
|
|
.until(() -> { |
|
|
|
actualKeys.set(doGetAsyncTyped(urlTemplate, new TypeReference<>() { |
|
|
|
})); |
|
|
|
@ -483,6 +484,7 @@ public abstract class AbstractMqttV5ClientSparkplugAttributesTest extends Abstra |
|
|
|
AtomicReference<List<String>> actualKeys = new AtomicReference<>(); |
|
|
|
await(alias + SparkplugMessageType.DBIRTH.name()) |
|
|
|
.atMost(40, TimeUnit.SECONDS) |
|
|
|
.ignoreExceptions() |
|
|
|
.until(() -> { |
|
|
|
actualKeys.set(doGetAsyncTyped(urlTemplate, new TypeReference<>() { |
|
|
|
})); |
|
|
|
|