diff --git a/application/src/main/data/upgrade/3.6.1/schema_update.sql b/application/src/main/data/upgrade/3.6.1/schema_update.sql index ebcf20a2c5b..cfe16f7ff82 100644 --- a/application/src/main/data/upgrade/3.6.1/schema_update.sql +++ b/application/src/main/data/upgrade/3.6.1/schema_update.sql @@ -35,3 +35,5 @@ ALTER TABLE resource ADD COLUMN IF NOT EXISTS external_id uuid; CREATE INDEX IF NOT EXISTS idx_resource_etag ON resource(tenant_id, etag); -- RESOURCES UPDATE END + +CREATE INDEX IF NOT EXISTS idx_edge_event_tenant_id_edge_id_created_time ON edge_event(tenant_id, edge_id, created_time DESC); \ No newline at end of file diff --git a/application/src/test/java/org/thingsboard/server/transport/coap/CoapTestCallback.java b/application/src/test/java/org/thingsboard/server/transport/coap/CoapTestCallback.java index 07eadd731d1..527846bc36d 100644 --- a/application/src/test/java/org/thingsboard/server/transport/coap/CoapTestCallback.java +++ b/application/src/test/java/org/thingsboard/server/transport/coap/CoapTestCallback.java @@ -25,9 +25,9 @@ @Data public class CoapTestCallback implements CoapHandler { - protected Integer observe; - protected byte[] payloadBytes; - protected CoAP.ResponseCode responseCode; + protected volatile Integer observe; + protected volatile byte[] payloadBytes; + protected volatile CoAP.ResponseCode responseCode; public Integer getObserve() { return observe; diff --git a/dao/src/main/resources/sql/schema-entities-idx.sql b/dao/src/main/resources/sql/schema-entities-idx.sql index 55df8e11bac..f0f378da690 100644 --- a/dao/src/main/resources/sql/schema-entities-idx.sql +++ b/dao/src/main/resources/sql/schema-entities-idx.sql @@ -67,10 +67,12 @@ CREATE INDEX IF NOT EXISTS idx_audit_log_id ON audit_log(id); CREATE INDEX IF NOT EXISTS idx_edge_event_tenant_id_and_created_time ON edge_event(tenant_id, created_time DESC); -CREATE INDEX IF NOT EXISTS idx_cloud_event_tenant_id_and_created_time ON cloud_event(tenant_id, created_time DESC); +CREATE INDEX IF NOT EXISTS idx_edge_event_tenant_id_edge_id_created_time ON edge_event(tenant_id, edge_id, created_time DESC); CREATE INDEX IF NOT EXISTS idx_edge_event_id ON edge_event(id); +CREATE INDEX IF NOT EXISTS idx_cloud_event_tenant_id_and_created_time ON cloud_event(tenant_id, created_time DESC); + CREATE INDEX IF NOT EXISTS idx_rpc_tenant_id_device_id ON rpc(tenant_id, device_id); CREATE INDEX IF NOT EXISTS idx_device_external_id ON device(tenant_id, external_id); diff --git a/pom.xml b/pom.xml index 42fe99e16b9..bfbf3e87aef 100755 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 3.11.14 31.1-jre 2.6.1 - 3.4 + 3.12.0 1.15 2.11.0 1.2 diff --git a/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/rest/TbHttpClientTest.java b/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/rest/TbHttpClientTest.java index d71d4aacbe1..bd69939f94e 100644 --- a/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/rest/TbHttpClientTest.java +++ b/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/rest/TbHttpClientTest.java @@ -18,7 +18,6 @@ import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; -import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; @@ -41,6 +40,7 @@ import java.net.URI; import java.util.List; import java.util.Map; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -169,21 +169,20 @@ public void testProcessMessageWithJsonInUrlVariable() throws Exception { capturedData.capture() )).thenReturn(successMsg); + CountDownLatch latch = new CountDownLatch(1); + httpClient.processMessage(ctx, msg, - m -> ctx.tellSuccess(msg), - ctx::tellFailure); - - Awaitility.await() - .atMost(30, TimeUnit.SECONDS) - .until(() -> { - try { - verify(ctx, times(1)).tellSuccess(any()); - return true; - } catch (Exception e) { - return false; - } + m -> { + ctx.tellSuccess(msg); + latch.countDown(); + }, + (m, t) -> { + ctx.tellFailure(m, t); + latch.countDown(); }); + latch.await(5, TimeUnit.SECONDS); + verify(ctx, times(1)).tellSuccess(any()); verify(ctx, times(0)).tellFailure(any(), any()); Assertions.assertEquals(successResponseBody, capturedData.getValue());