wy471x opened a new pull request, #7403: URL: https://github.com/apache/shenyu/pull/7403
<!-- Describe your PR here; e.g. Fixes #issueNo --> This repairs `HeartbeatFailureIsolationTest`, the regression test added in #7260 and left broken by the #7082 register publisher startup refactor. <!-- Thank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request. --> Make sure that: - [X] You have read the [contribution guidelines](https://shenyu.apache.org/community/contributor-guide). - [X] You submit test cases (unit or integration tests) that back your changes. - [X] Your local test passed `./mvnw clean install -Dmaven.javadoc.skip=true`. ## Summary `ShenyuClientURIExecutorSubscriber` used to schedule its periodic heartbeat from the constructor. #7082 moved the `scheduleAtFixedRate` call into a new idempotent `start()` method, so the executor queue stays empty until `start()` is called. `HeartbeatFailureIsolationTest` reflected the executor queue right after construction, hit `java.util.NoSuchElementException` at line 57, and failed the `shenyu-client-core` module tests. ### Changes: 1. `HeartbeatFailureIsolationTest.failureDoesNotSuppressOtherUrisOrSubsequentTicks` (HeartbeatFailureIsolationTest.java:48) — calls `subscriber.start()` before draining the scheduled task from the queue, matching the publisher lifecycle introduced by #7082. No production code changed. ### Test Cases: 1. `HeartbeatFailureIsolationTest.failureDoesNotSuppressOtherUrisOrSubsequentTicks` — runs two heartbeat ticks with a repository that throws for one of two URIs, then verifies the failing heartbeat is retried, the healthy URI is still reported, and the periodic task remains schedulable (`assertFalse(task.isDone())`). ## Verification - `JAVA_HOME=<JDK 21> ./mvnw -pl shenyu-client/shenyu-client-core -am clean install -Dmaven.javadoc.skip=true` — 101 tests in shenyu-client-core, 0 failures, 0 errors; checkstyle and RAT (bound to `validate`) pass. - Without the change the test fails with `java.util.NoSuchElementException` at `HeartbeatFailureIsolationTest.java:57`; with it the test passes. Related to #7260. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
