File tree 2 files changed +13
-2
lines changed
flink-kubernetes-operator/src
main/java/org/apache/flink/kubernetes/operator
test/java/org/apache/flink/kubernetes/operator
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ private void overrideOperatorConfigs(ConfigurationServiceOverrider overrider) {
137
137
overrider .withExecutorService (Executors .newCachedThreadPool ());
138
138
} else {
139
139
LOG .info ("Configuring operator with {} reconciliation threads." , parallelism );
140
- overrider .withConcurrentReconciliationThreads ( parallelism );
140
+ overrider .withExecutorService ( Executors . newFixedThreadPool ( parallelism ) );
141
141
}
142
142
143
143
if (operatorConf .isJosdkMetricsEnabled ()) {
Original file line number Diff line number Diff line change @@ -70,11 +70,22 @@ public void testConfigurationPassedToJOSDK() {
70
70
71
71
var configService = testOperator .getOperator ().getConfigurationService ();
72
72
73
- // Test parallelism being passed
73
+ // Test parallelism being passed expectedly
74
74
var executorService = configService .getExecutorService ();
75
75
Assertions .assertInstanceOf (ThreadPoolExecutor .class , executorService );
76
76
ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor ) executorService ;
77
+ for (int i = 0 ; i < testParallelism * 2 ; i ++) {
78
+ threadPoolExecutor .execute (
79
+ () -> {
80
+ try {
81
+ Thread .sleep (1000 );
82
+ } catch (InterruptedException e ) {
83
+ e .printStackTrace ();
84
+ }
85
+ });
86
+ }
77
87
Assertions .assertEquals (threadPoolExecutor .getMaximumPoolSize (), testParallelism );
88
+ Assertions .assertEquals (threadPoolExecutor .getPoolSize (), testParallelism );
78
89
79
90
// Test label selector being passed
80
91
// We have a label selector for each controller
You can’t perform that action at this time.
0 commit comments