tillrohrmann commented on a change in pull request #10555: [FLINK-15013] Fix
non local slot selection and root slot resolution
URL: https://github.com/apache/flink/pull/10555#discussion_r357684282
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/clusterframework/types/LocationPreferenceSlotSelectionStrategyTest.java
##########
@@ -76,24 +84,27 @@ public void matchNoRequirements() {
SlotProfile slotProfile = SlotProfile.noRequirements();
Optional<SlotSelectionStrategy.SlotInfoAndLocality> match =
runMatching(slotProfile);
- Assert.assertTrue(
- candidates.stream()
-
.map(SlotSelectionStrategy.SlotInfoAndResources::getSlotInfo)
- .collect(Collectors.toList())
-
.contains(match.get().getSlotInfo()));
+ Assert.assertTrue(match.isPresent());
+ final SlotSelectionStrategy.SlotInfoAndLocality
slotInfoAndLocality = match.get();
+ assertThat(candidates,
hasItem(withSlotInfo(slotInfoAndLocality.getSlotInfo())));
+ assertThat(slotInfoAndLocality.getLocality(),
is(Locality.UNCONSTRAINED));
}
@Test
- public void matchPreferredLocationNotAvailable() {
+ public void
returnsHostLocalMatchingIfExactTMLocationCannotBeFulfilled() {
SlotProfile slotProfile =
SlotProfile.preferredLocality(resourceProfile, Collections.singletonList(tmlX));
Optional<SlotSelectionStrategy.SlotInfoAndLocality> match =
runMatching(slotProfile);
- Assert.assertTrue(
- candidates.stream()
-
.map(SlotSelectionStrategy.SlotInfoAndResources::getSlotInfo)
- .collect(Collectors.toList())
-
.contains(match.get().getSlotInfo()));
+ Assert.assertTrue(match.isPresent());
+ final SlotSelectionStrategy.SlotInfoAndLocality
slotInfoAndLocality = match.get();
+ final SlotInfo slotInfo = slotInfoAndLocality.getSlotInfo();
+ assertThat(candidates, hasItem(withSlotInfo(slotInfo)));
+ assertThat(slotInfoAndLocality.getLocality(),
is(Locality.HOST_LOCAL));
Review comment:
I actually pulled this change out into a separate commit.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services