This is an automated email from the ASF dual-hosted git repository.
zrlw pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/dubbo-integration-cases.git
The following commit(s) were added to refs/heads/main by this push:
new 4c8146d7 Optimized dubbo-samples-test-13078 to avoid RpcException with
no provider available (#66)
4c8146d7 is described below
commit 4c8146d7624e385b1621d9a2c728f67cd8b14578
Author: zrlw <[email protected]>
AuthorDate: Tue Jun 10 20:36:35 2025 +0800
Optimized dubbo-samples-test-13078 to avoid RpcException with no provider
available (#66)
* Optimized dubbo-samples-test-13078 to avoid RpcException with no provider
available
* Replace jdk version of nightly-dubbo-3.yml from 11 to 17
---
.github/workflows/nightly-dubbo-3.yml | 4 ++--
.../org/apache/dubbo/samples/client/GreetingServiceIT.java | 12 +++++++++++-
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/nightly-dubbo-3.yml
b/.github/workflows/nightly-dubbo-3.yml
index fa829ce0..db6b00ee 100644
--- a/.github/workflows/nightly-dubbo-3.yml
+++ b/.github/workflows/nightly-dubbo-3.yml
@@ -129,7 +129,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- java: [8, 11]
+ java: [8, 17]
#testjob id list MUST match 'JOB_COUNT' of 'prepare_test'
job_id: [1,2,3,4,5]
steps:
@@ -181,7 +181,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- java: [8, 11]
+ java: [8, 17]
env:
JAVA_VER: ${{matrix.java}}
steps:
diff --git
a/99-integration/dubbo-samples-test-13078/src/test/java/org/apache/dubbo/samples/client/GreetingServiceIT.java
b/99-integration/dubbo-samples-test-13078/src/test/java/org/apache/dubbo/samples/client/GreetingServiceIT.java
index 8ac4b517..ceda1409 100644
---
a/99-integration/dubbo-samples-test-13078/src/test/java/org/apache/dubbo/samples/client/GreetingServiceIT.java
+++
b/99-integration/dubbo-samples-test-13078/src/test/java/org/apache/dubbo/samples/client/GreetingServiceIT.java
@@ -49,13 +49,15 @@ public class GreetingServiceIT {
Assertions.assertEquals("hi, dubbo", message);
}
+ // make nextReservationStreamId less than zero to trigger server
sending back GO_AWAY frame on next rpc.
List<Http2Connection.Endpoint<Http2LocalFlowController>> endpoints =
WireProtocolWrapper.getEndpoints();
Assertions.assertEquals(1, endpoints.size());
Http2Connection.Endpoint<Http2LocalFlowController> endpoint =
endpoints.get(0);
- while (endpoint.incrementAndGetNextStreamId() > 0) {
+ while (endpoint.incrementAndGetNextStreamId() >= 0) {
endpoint.incrementAndGetNextStreamId();
}
+ // get server GO_AWAY frame and reconnect to server.
try {
service.sayHi("dubbo");
Assertions.fail();
@@ -63,9 +65,17 @@ public class GreetingServiceIT {
Assertions.assertEquals("java.util.concurrent.ExecutionException:
org.apache.dubbo.rpc.StatusRpcException: INTERNAL : Http2 exception",
e.getMessage());
}
+ // wait connection reconnected.
await().atMost(60, TimeUnit.SECONDS).untilAsserted(
() -> Assertions.assertEquals(2, endpoints.size()));
+ // wait invoker re-valid to avoid RpcException with no provider
available.
+ try {
+ reference.checkOrDestroy(1000);
+ } catch (IllegalStateException e) {
+ Assertions.fail();
+ }
+
for (int i = 0; i < 100; i++) {
String message = service.sayHi("dubbo");
Assertions.assertEquals("hi, dubbo", message);