-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-10610] [tests] Port slot sharing cases to new codebase #6883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ef791d8 to
57b761d
Compare
|
ping @tillrohrmann |
flink-runtime/src/test/java/org/apache/flink/runtime/minicluster/CountDownLatchedSender.java
Outdated
Show resolved
Hide resolved
flink-runtime/src/test/java/org/apache/flink/runtime/minicluster/MiniClusterITCase.java
Show resolved
Hide resolved
flink-runtime/src/test/java/org/apache/flink/runtime/minicluster/MiniClusterITCase.java
Outdated
Show resolved
Hide resolved
flink-runtime/src/test/java/org/apache/flink/runtime/minicluster/CountDownLatchedSender.java
Outdated
Show resolved
Hide resolved
flink-runtime/src/test/java/org/apache/flink/runtime/minicluster/MiniClusterITCase.java
Show resolved
Hide resolved
|
What about the |
|
Address comments. For |
|
checkstyle: |
flink-runtime/src/main/java/org/apache/flink/runtime/minicluster/MiniCluster.java
Outdated
Show resolved
Hide resolved
flink-runtime/src/test/java/org/apache/flink/runtime/minicluster/MiniClusterITCase.java
Outdated
Show resolved
Hide resolved
|
Thanks for your review very much @zentol ! Address comments. |
| ResultPartitionType.PIPELINED); | ||
|
|
||
| final CountDownLatch countDownLatch = new CountDownLatch(parallelism); | ||
| CountDownLatchedSender.setLatch(countDownLatch); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test must also not be run in parallel to testSlotSharingForForwardJobWithCoLocationConstraint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I add a ReentrantLock to guard settings to these CountDownLatchs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, the synchronization can be removed since multiple tests are not run in parallel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: if the test had failed another test could've been blocked indefinitely since you aren't calling unlock in a finally block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm thanks for you education and sorry for so inexperienced. will remove the synchronization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it make sense that we move unlock to finally block for possible parallel testing? or defer the synchronization until we really make it parallelized.
31f2461 to
cc6b1b7
Compare
cc6b1b7 to
56e9686
Compare
|
Sorry for joining so late to the party. I actually missed this PR and accidentally opened #7689. While porting the tests, I think that we can completely remove the Moreover, with #7676 I added some functionality for terminating and starting new I also think that |
tillrohrmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry again for not seeing this PR. I didn't properly check JIRA. I think we should only keep the CoLocationConstraintITCase and remove the other tests.
| checkState(running, "MiniCluster is not yet running."); | ||
| return taskManagers; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to do this differently. Please take a look at #7676.
| .setConfiguration(configuration) | ||
| .build(); | ||
|
|
||
| try (final MiniCluster miniCluster = new MiniCluster(cfg)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be a good idea to separate tests which modify the MiniCluster from those which don't. For the latter, the MiniCluster could be started for the test class instead for every test. This will speed up the execution.
|
@tillrohrmann thanks for your guide. Now I see the reason that slot sharing isn't really tested and approve that we should only port I've moved to #7690 and find that even we don't have code below we can pass the test. Maybe we can set a CountDownLatch like this pr does? final SlotSharingGroup slotSharingGroup = new SlotSharingGroup();
receiver.setSlotSharingGroup(slotSharingGroup);
sender.setSlotSharingGroup(slotSharingGroup);
receiver.setStrictlyCoLocatedWith(sender);basically it's OK to me that we close this thread and move discussions to #7689 #7690 and #7676 |
|
You're right that #7690 does not contain any assertions that |
What is the purpose of the change
Port
CoLocationConstraintITCaseandSlotSharingITCaseto new codebase.Brief change log
Introduce
CountDownLatchedReceiver,CountDownLatchedSenderandCountDownLatchedAgnosticBinaryReceiver, which the sender only finished on all receiver running. It is for prevent the sender finish causing return the slot, which breaks testing purpose.do the porting job and replace
TestingClusterwithMiniCluster.Verifying this change
This change is a trivial rework and it itself the test.
Does this pull request potentially affect one of the following parts:
(Evolving): (no)Documentation
cc @tillrohrmann