[ 
https://issues.apache.org/jira/browse/FLINK-33000?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17763013#comment-17763013
 ] 

Haode Du commented on FLINK-33000:
----------------------------------

Thanks for the quick reply. In terms of the fixed number of threads, I have 
noticed that in 
[{{testSubmitOperationAndCloseOperationManagerInParallel2()}}|https://github.com/apache/flink/blob/c9e87fe410c42f7e7c19c81456d4212a58564f5e/flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/service/SqlGatewayServiceITCase.java#L833]
 , 3 threads are opened and they wait the same {{{}CountDownLatch{}}}.  I'm not 
sure if these 3 threads should all start to wait for {{OperationManager}} to 
close, because {{startRunning}} lock is only set at 1, which is a little 
confusing to me. If it is ok to keep only 1 thread alive, the default 
{{TestExcutorExtension}} with single thread pool can be used.


As for the {{{}AbstractTextBase{}}},  I think {{SqlGatewayServiceITcase}} is 
not a child of AbstractTestBase now.  {{AbstractTestBase}} doesn't occur in the 
code and it seems that JUnit5 functionality has been already used.

> 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)

Reply via email to