FrankChen021 commented on code in PR #20824:
URL: https://github.com/apache/druid/pull/20824#discussion_r4455496948
##########
embedded-tests/src/test/java/org/apache/druid/testing/embedded/server/OverlordClientTest.java:
##########
@@ -134,6 +137,31 @@ public void test_cancelTask_ofTypeNoop_andLongRunDuration()
);
}
+ @Test
+ public void test_shutdownAllTasks_forDatasourceWithActiveTask()
Review Comment:
I think this test case does not cover all the case, or it's hard to tell how
much it helps to prevent future regression.
The problem here is how Jersery registers endpoints and find endpoints.
`@Path("/datasources/{dataSource}/shutdownAllTasks")` in `OverlordResource`
is shadowed by `OverlordDataSourceResource`, a better test case should target
the 'shadowing' problem across endpoints, not only current case.
We can do this in the `MainTest.java`
```java
@ParameterizedTest(name = "{0}")
@MethodSource("runnables")
public void testNoShadowedEndpoints(final ServerRunnable runnable)
{
final Injector startupInjector = GuiceInjectors.makeStartupInjector();
startupInjector.injectMembers(runnable);
final Injector serviceInjector =
runnable.makeInjector(runnable.getNodeRoles(new Properties()));
final Set<Class<?>> resources = serviceInjector.getInstance(
Key.get(new TypeLiteral<Set<Class<?>>>() {}, JSR311Resource.class)
);
// need to impl the logic here to validate no endpoint showdowing
assertNoShadowedMethods(resources)
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]