Skip to content

Commit

Permalink
*Fix graceful shutdown notify failure
Browse files Browse the repository at this point in the history
Signed-off-by: provenceee <[email protected]>
  • Loading branch information
provenceee committed Sep 27, 2024
1 parent 4a0d114 commit 83f7d32
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/actions/scenarios/spring/graceful/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ runs:
bash ./sermant-integration-tests/scripts/checkService.sh http://127.0.0.1:8014/testGraceful 60
- name: test graceful up
shell: bash
run: mvn test -Dsermant.integration.test.type=GRACEFUL_FEIGN -Dgraceful.test.type=up --file sermant-integration-tests/spring-test/pom.xml
- name: test graceful up
shell: bash
run: mvn test -Dsermant.integration.test.type=GRACEFUL_REST -Dgraceful.test.type=up --file sermant-integration-tests/spring-test/pom.xml
run: |
mvn test -Dsermant.integration.test.type=GRACEFUL_FEIGN -Dgraceful.test.type=up --file sermant-integration-tests/spring-test/pom.xml
mvn test -Dsermant.integration.test.type=GRACEFUL_REST -Dgraceful.test.type=up --file sermant-integration-tests/spring-test/pom.xml
- name: test rest graceful down
shell: bash
run: |
Expand All @@ -80,6 +79,7 @@ runs:
- name: test feign graceful down
shell: bash
run: |
mvn test -Dsermant.integration.test.type=GRACEFUL_FEIGN -Ddown.request.count=10 -Dgraceful.test.type=down --file sermant-integration-tests/spring-test/pom.xml
jps -l | grep graceful-feign-provider | awk '{print $1}' | xargs -n 1 kill
echo "========start test graceful======="
jps -l
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public abstract class GracefulTest {

private static final int UP_REQUEST_COUNT = 500;

private static final int DOWN_REQUEST_COUNT = 1000;
private static final String DOWN_REQUEST_COUNT = "1000";

private final String url = getBaseUrl();

Expand Down Expand Up @@ -104,7 +104,7 @@ public void testGracefulDown() {
return;
}
try {
for (int i = 0; i < DOWN_REQUEST_COUNT; i++) {
for (int i = 0; i < getDownRequestCount(); i++) {
RequestUtils.get(buildUrl("testGraceful"), Collections.emptyMap(), String.class);
}
} catch (Exception exception) {
Expand All @@ -113,6 +113,10 @@ public void testGracefulDown() {
}
}

private int getDownRequestCount() {
return Integer.parseInt(EnvUtils.getEnv("down.request.count", DOWN_REQUEST_COUNT));
}

private void statistic(Map<String, Integer> statisticMap) {
final String port = RequestUtils.get(buildUrl("testGraceful"), Collections.emptyMap(),
String.class);
Expand Down

0 comments on commit 83f7d32

Please sign in to comment.