[
https://issues.apache.org/jira/browse/FLINK-33000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17762987#comment-17762987
]
Haode Du commented on FLINK-33000:
----------------------------------
[~mapohl], I have 2 questions on concrete implementation:
1. It seems that only {{ScheduledThreadPool}} or {{FixedThreadPool}} can meet
the requirements. Using {{CachedThreadPool}} will result in out-of-order in
cancel operation and close operation (because this thread pool is not FIFO by
default). Although the test can pass at this time, it will leave a large number
of exceptions. It seems that there will be at most 3-4 threads in the thread
pool at the same time, so the default single thread pool is also not proper.
Can the {{corePoolSize}} be hardcoded as 4? like this:
{quote}public static final TestExecutorExtension<ExecutorService>
EXECUTOR_EXTENSION =
new TestExecutorExtension<>(() -> Executors.newScheduledThreadPool(4));
{quote}
I'm not really sure that if hardcoding is allowed here.
2. The {{AbstractTestBase}} class still seems to be inherited by many other
Test classes, is there any risk to remove this class? The
{{SQLGatewayServiceITCase}} class does not inherit any other class, I'm not
quite sure which abstract class I should delete and the relation between the
use of JUnit5 in this class and the removal of {{AbstractTestBase}} .
> SqlGatewayServiceITCase should utilize TestExecutorExtension instead of using
> a ThreadFactory
> ---------------------------------------------------------------------------------------------
>
> Key: FLINK-33000
> URL: https://issues.apache.org/jira/browse/FLINK-33000
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / Gateway, Tests
> Affects Versions: 1.16.2, 1.18.0, 1.17.1, 1.19.0
> Reporter: Matthias Pohl
> Priority: Major
> Labels: starter
>
> {{SqlGatewayServiceITCase}} uses a {{ExecutorThreadFactory}} for its
> asynchronous operations. Instead, one should use {{TestExecutorExtension}} to
> ensure proper cleanup of threads.
> We might also want to remove the {{AbstractTestBase}} parent class because
> that uses JUnit4 whereas {{SqlGatewayServiceITCase}} is already based on
> JUnit5
--
This message was sent by Atlassian Jira
(v8.20.10#820010)