From cedaebc1578fde4c5b846f2353ee1d798a481d64 Mon Sep 17 00:00:00 2001 From: artur-ciocanu Date: Thu, 26 Sep 2024 20:41:08 +0300 Subject: [PATCH] Ensure we use the same GRPC version everywhere (#1137) * Ensure we use the same GRPC version everywhere Signed-off-by: Artur Ciocanu * Fix actors tests assert Signed-off-by: Artur Ciocanu * Revert Dapr exception asserts Signed-off-by: Artur Ciocanu * Increase sleep to allow Spring Context to bootstrap Signed-off-by: Artur Ciocanu * Revert sleep value Signed-off-by: Artur Ciocanu * Increase the sleep for messaging test Signed-off-by: Artur Ciocanu * Move sleep before each, to ensure Spring context starts Signed-off-by: Artur Ciocanu * Add more delays to ensure Spring Controller gets the messages Signed-off-by: Artur Ciocanu --------- Signed-off-by: Artur Ciocanu Co-authored-by: Artur Ciocanu --- pom.xml | 4 ++-- sdk-actors/pom.xml | 1 - .../java/io/dapr/actors/client/DaprGrpcClientTest.java | 2 +- .../java/io/dapr/actors/runtime/DaprGrpcClientTest.java | 4 ++-- .../dapr/it/spring/messaging/DaprSpringMessagingIT.java | 8 ++++++-- sdk/pom.xml | 1 - 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index c8cf9699c..17573f976 100644 --- a/pom.xml +++ b/pom.xml @@ -104,13 +104,13 @@ io.grpc grpc-testing - 1.56.1 + ${grpc.version} test io.grpc grpc-inprocess - 1.59.0 + ${grpc.version} test diff --git a/sdk-actors/pom.xml b/sdk-actors/pom.xml index e24f33ecb..940d25609 100644 --- a/sdk-actors/pom.xml +++ b/sdk-actors/pom.xml @@ -18,7 +18,6 @@ false - 1.59.0 diff --git a/sdk-actors/src/test/java/io/dapr/actors/client/DaprGrpcClientTest.java b/sdk-actors/src/test/java/io/dapr/actors/client/DaprGrpcClientTest.java index aeb450c9a..313eca5a7 100644 --- a/sdk-actors/src/test/java/io/dapr/actors/client/DaprGrpcClientTest.java +++ b/sdk-actors/src/test/java/io/dapr/actors/client/DaprGrpcClientTest.java @@ -129,7 +129,7 @@ public void invokeException() { ExecutionException.class, "UNKNOWN", "UNKNOWN: ", - () -> result.block()); + result::block); } @Test diff --git a/sdk-actors/src/test/java/io/dapr/actors/runtime/DaprGrpcClientTest.java b/sdk-actors/src/test/java/io/dapr/actors/runtime/DaprGrpcClientTest.java index 815186e60..335ea575f 100644 --- a/sdk-actors/src/test/java/io/dapr/actors/runtime/DaprGrpcClientTest.java +++ b/sdk-actors/src/test/java/io/dapr/actors/runtime/DaprGrpcClientTest.java @@ -96,7 +96,7 @@ public void getActorStateException() { assertThrowsDaprException( ExecutionException.class, "UNKNOWN", - "UNKNOWN: ", + "UNKNOWN: Application error processing RPC", result::block); } @@ -112,7 +112,7 @@ public void saveActorStateTransactionallyException() { assertThrowsDaprException( ExecutionException.class, "UNKNOWN", - "UNKNOWN: ", + "UNKNOWN: Application error processing RPC", result::block); } @Test diff --git a/sdk-tests/src/test/java/io/dapr/it/spring/messaging/DaprSpringMessagingIT.java b/sdk-tests/src/test/java/io/dapr/it/spring/messaging/DaprSpringMessagingIT.java index 19b6e3252..50d5b9114 100644 --- a/sdk-tests/src/test/java/io/dapr/it/spring/messaging/DaprSpringMessagingIT.java +++ b/sdk-tests/src/test/java/io/dapr/it/spring/messaging/DaprSpringMessagingIT.java @@ -76,10 +76,15 @@ public class DaprSpringMessagingIT { private TestRestController testRestController; @BeforeAll - public static void setup(){ + public static void beforeAll(){ org.testcontainers.Testcontainers.exposeHostPorts(8080); } + @BeforeEach + public void beforeEach() throws InterruptedException { + Thread.sleep(1000); + } + @Test public void testDaprMessagingTemplate() throws InterruptedException { for (int i = 0; i < 10; i++) { @@ -97,5 +102,4 @@ public void testDaprMessagingTemplate() throws InterruptedException { assertThat(events.size()).isEqualTo(10); } - } diff --git a/sdk/pom.xml b/sdk/pom.xml index 66095e0b2..efa79cd6c 100644 --- a/sdk/pom.xml +++ b/sdk/pom.xml @@ -18,7 +18,6 @@ false - 1.59.0 --add-opens java.base/java.util=ALL-UNNAMED