-
Notifications
You must be signed in to change notification settings - Fork 219
fix: PerResourcePollingEventSource issue with resources #1417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -134,8 +134,8 @@ public final synchronized void registerEventSource(String name, EventSource even | |||
@SuppressWarnings("unchecked") | |||
public void broadcastOnResourceEvent(ResourceAction action, R resource, R oldResource) { | |||
eventSources.additionalNamedEventSources().forEach(eventSource -> { | |||
if (eventSource instanceof ResourceEventAware) { | |||
var lifecycleAwareES = ((ResourceEventAware<R>) eventSource); | |||
if (eventSource.original() instanceof ResourceEventAware) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there possibly other spots where a similar change would be needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, good question, probably not, since it works. Just this did not have a integration test.
.build(); | ||
|
||
@Test | ||
void managedDependentsAreReconciledInOrder() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test name doesn't make sense…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed.
EventSourceContext<PerResourceEventSourceCustomResource> context) { | ||
this.eventSource = | ||
new PerResourcePollingEventSource<>(primaryResource -> { | ||
numberOfFetchExecutions.addAndGet(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't the test make more sense if it checked that it's actually called once per primary resource? Right now, it only checks the fetcher is called, not that it's called per resource.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, true, will improve the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
0fed7d2
to
4c8a9b1
Compare
4c8a9b1
to
e085ba3
Compare
Kudos, SonarCloud Quality Gate passed! |
No description provided.