huwh commented on code in PR #22424:
URL: https://github.com/apache/flink/pull/22424#discussion_r1174540181
##########
flink-runtime/src/test/java/org/apache/flink/runtime/clusterframework/types/SlotSelectionStrategyTestBase.java:
##########
@@ -59,26 +58,25 @@ public abstract class SlotSelectionStrategyTestBase extends
TestLogger {
protected final SlotInfoWithUtilization slotInfo1 =
SlotInfoWithUtilization.from(
- new SimpleSlotContext(aid1, tml1, 1, taskManagerGateway,
resourceProfile), 0);
+ new SimpleSlotContext(aid1, tml1, 1, taskManagerGateway,
resourceProfile),
+ ignored -> 0.0d);
protected final SlotInfoWithUtilization slotInfo2 =
SlotInfoWithUtilization.from(
new SimpleSlotContext(aid2, tml2, 2, taskManagerGateway,
biggerResourceProfile),
- 0);
+ ignored -> 0.0d);
protected final SlotInfoWithUtilization slotInfo3 =
SlotInfoWithUtilization.from(
- new SimpleSlotContext(aid3, tml3, 3, taskManagerGateway,
resourceProfile), 0);
+ new SimpleSlotContext(aid3, tml3, 3, taskManagerGateway,
resourceProfile),
+ ignored -> 0.0d);
protected final SlotInfoWithUtilization slotInfo4 =
SlotInfoWithUtilization.from(
- new SimpleSlotContext(aid4, tml4, 4, taskManagerGateway,
resourceProfile), 0);
+ new SimpleSlotContext(aid4, tml4, 4, taskManagerGateway,
resourceProfile),
+ ignored -> 0.0d);
protected final Set<SlotSelectionStrategy.SlotInfoAndResources> candidates
=
Collections.unmodifiableSet(createCandidates());
- protected final SlotSelectionStrategy selectionStrategy;
-
- public SlotSelectionStrategyTestBase(SlotSelectionStrategy
slotSelectionStrategy) {
- this.selectionStrategy = slotSelectionStrategy;
- }
Review Comment:
Previously, we used different constructors to create different
SlotSelectionStrategy. On Junit5, the test class is required to have only one
constructor, which causes LocationPreferenceSlotSelectionStrategyTest not
working properly. It has two constructors, one to create
DefaultLocationPreferenceSlotSelectionStrategy, and one for subclass
PreviousAllocationSlotSelectionStrategyTest to create
PreviousAllocationSlotSelectionStrategy
So here we change to create different SlotSelectionStrategy by BeforeEach
function. The constructor is not used.
--
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]