You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by "eye-gu (via GitHub)" <gi...@apache.org> on 2026/10/01 10:45:48 UTC
[I] DataChangedEventDispatcherTest fails on master since #7342 (verify targets 2-arg onPluginChanged but dispatcher invokes 3-arg overload) [shenyu]
eye-gu opened a new issue, #7393:
URL: https://github.com/apache/shenyu/issues/7393
### Description
Since PR #7342 was merged (commit e27fb02f6, 2026-10-01), the `ci` workflow fails on
master with 3 test failures in `org.apache.shenyu.admin.listener.DataChangedEventDispatcherTest`:
- `onApplicationEventNotMasterForwardsEventAndKeepsAbstractListenersTest:343`
- `onApplicationEventNotMasterForwardFailedStillUpdatesLocalCachesTest:359`
- `onApplicationEventStandaloneNeverForwardsTest:372`
Latest master CI run on `a12aa3e5` fails with `Tests run: 1721, Failures: 3`:
https://github.com/apache/shenyu/actions/runs/36828192900
### Root cause
`DataChangedEventDispatcher.dispatch()` invokes the 3-arg overload
(`DataChangedEventDispatcher.java:115`):
listener.onPluginChanged((List<PluginData>) event.getSource(), event.getEventType(), event.getNamespaceId());
but the new tests verify the 2-arg overload:
verify(httpLongPollingDataChangedListener, times(1)).onPluginChanged(anyList(), any());
In `DataChangedListener` the 3-arg method is a default method delegating to the 2-arg
one (`DataChangedListener.java:74-75`). Since the tests use plain `@Mock` listeners,
Mockito does not execute default-method bodies, so the 2-arg method is never invoked:
Argument(s) are different! Wanted:
httpLongPollingDataChangedListener.onPluginChanged(<any List>, <any>);
Actual invocations have different arguments:
httpLongPollingDataChangedListener.onPluginChanged([], null, null);
-> at DataChangedEventDispatcher.dispatch(DataChangedEventDispatcher.java:115)
### Suggested fix
Align the verifications in these 3 tests with the 3-arg overload, same pattern as the
passing tests at lines 287-290:
verify(httpLongPollingDataChangedListener, times(1)).onPluginChanged(anyList(), any(), any());
Lines 386/405 use `never()` on the 2-arg overload, which is trivially true for the same
reason and worth aligning as well.
--
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: notifications-unsubscribe@shenyu.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] DataChangedEventDispatcherTest fails on master since #7342 (verify targets 2-arg onPluginChanged but dispatcher invokes 3-arg overload) [shenyu]
Posted by "wy471x (via GitHub)" <gi...@apache.org>.
wy471x closed issue #7393: DataChangedEventDispatcherTest fails on master since #7342 (verify targets 2-arg onPluginChanged but dispatcher invokes 3-arg overload)
URL: https://github.com/apache/shenyu/issues/7393
--
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: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] DataChangedEventDispatcherTest fails on master since #7342 (verify targets 2-arg onPluginChanged but dispatcher invokes 3-arg overload) [shenyu]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #7393:
URL: https://github.com/apache/shenyu/issues/7393#issuecomment-5929768409
👋 Hello @yuluo-yx
A new issue has been opened by @eye-gu:
- **Title**: DataChangedEventDispatcherTest fails on master since #7342 (verify targets 2-arg onPluginChanged but dispatcher invokes 3-arg overload)
- **Link**: https://github.com/apache/shenyu/issues/7393
Please review when you have time. Thank you! 🙏
--
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: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org