shenyu icon indicating copy to clipboard operation
shenyu copied to clipboard

[BUG] Heartbeat failure isolation test reads an unscheduled task

Open sunnysabor opened this issue 2 months ago • 2 comments

Description

HeartbeatFailureIsolationTest.failureDoesNotSuppressOtherUrisOrSubsequentTicks fails on the current master because it expects the subscriber's scheduled heartbeat task to be present in the executor queue, but the test constructs the subscriber without calling start().

The failure is deterministic in a clean worktree at upstream/master (09c6a5287330c8d6ada64cd29f2a08a570b0b2ab): NoSuchElementException at HeartbeatFailureIsolationTest.java:57 when executor.getQueue().iterator().next() is evaluated. The same failure appears in the full CI run for PR #7397, although that PR only changes the AI API module.

Expected behavior

The regression test should explicitly schedule the periodic task before retrieving and manually invoking it, then verify failures do not suppress other URI heartbeats or future ticks.

Validation

Reproduction command:

./mvnw -B -pl shenyu-client/shenyu-client-core -Dtest=HeartbeatFailureIsolationTest -Djacoco.skip=true -Dmaven.javadoc.skip=true test

On current master, this command fails with the line-57 NoSuchElementException.

sunnysabor avatar Oct 01 '26 13:10 sunnysabor

👋 Hello @Aias00

A new issue has been opened by @sunnysabor:

  • Title: [BUG] Heartbeat failure isolation test reads an unscheduled task
  • Link: https://github.com/apache/shenyu/issues/7401

Please review when you have time. Thank you! 🙏

github-actions[bot] avatar Oct 01 '26 13:10 github-actions[bot]

There are now two PRs for the same test failure: #7402 (opened from this issue) and #7403 (opened as a follow-up to #7260). Both add subscriber.start() before manually draining the scheduled task. I rechecked the scheduler: its first execution is delayed by 30 seconds, so #7403 does not trigger an immediate run before the fixture is populated under normal test execution; #7402 still has the slightly safer ordering because it completes setup before scheduling. The changes are otherwise equivalent, so please merge only one. I am happy to close #7402 if maintainers prefer #7403.

sunnysabor avatar Oct 01 '26 14:10 sunnysabor