gyfora commented on code in PR #790:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/790#discussion_r1515637312
##########
flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/FlinkOperatorTest.java:
##########
@@ -70,10 +70,21 @@ public void testConfigurationPassedToJOSDK() {
var configService =
testOperator.getOperator().getConfigurationService();
- // Test parallelism being passed
+ // Test parallelism being passed expectedly
var executorService = configService.getExecutorService();
Assertions.assertInstanceOf(ThreadPoolExecutor.class, executorService);
ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor)
executorService;
+ for (int i = 0; i < testParallelism * 2; i++) {
+ threadPoolExecutor.execute(
+ () -> {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ });
+ }
Review Comment:
Maybe we could do a more functional test that will hold even if the service
implementation changes.
1. Set a smaller parallelism to not use soo many threads
2. For 2x the parallelism like you did we execute:
- Increment atomic counter
- Sleep for long (lets say 10sec)
3. Assert the counter == 2x parallelism
Wdyt? It would be good to test that the test actually fails before the
change
--
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]