Skip to content

Commit

Permalink
[FLINK-25925][tests] Require slot pool to only accept the same set of…
Browse files Browse the repository at this point in the history
… slots as before

Instead of also accepting excess slots, we only need to require the same set of slots
as before. This commit changes the JobMasterTest.testJobMasterAcceptsExcessSlotsWhenJobIsRestarting
accordingly.

This closes apache#18608.
  • Loading branch information
tillrohrmann committed Feb 3, 2022
1 parent d9d72ef commit 2317ab4
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1926,10 +1926,11 @@ public void testJobMasterOnlyTerminatesAfterTheSchedulerHasClosed() throws Excep
}

@Test
public void testJobMasterAcceptsExcessSlotsWhenJobIsRestarting() throws Exception {
public void testJobMasterAcceptsSlotsWhenJobIsRestarting() throws Exception {
configuration.set(RestartStrategyOptions.RESTART_STRATEGY, "fixed-delay");
configuration.set(
RestartStrategyOptions.RESTART_STRATEGY_FIXED_DELAY_DELAY, Duration.ofDays(1));
final int numberSlots = 1;
final JobMaster jobMaster =
new JobMasterBuilder(jobGraph, rpcService)
.withConfiguration(configuration)
Expand All @@ -1941,20 +1942,23 @@ public void testJobMasterAcceptsExcessSlotsWhenJobIsRestarting() throws Exceptio
final JobMasterGateway jobMasterGateway =
jobMaster.getSelfGateway(JobMasterGateway.class);

assertThat(
jobMasterGateway.requestJobStatus(testingTimeout).get(), is(JobStatus.RUNNING));

final LocalUnresolvedTaskManagerLocation unresolvedTaskManagerLocation =
new LocalUnresolvedTaskManagerLocation();
registerSlotsAtJobMaster(
1,
numberSlots,
jobMasterGateway,
jobGraph.getJobID(),
new TestingTaskExecutorGatewayBuilder()
.setAddress("firstTaskManager")
.createTestingTaskExecutorGateway(),
unresolvedTaskManagerLocation);

CommonTestUtils.waitUntilCondition(
() ->
jobMasterGateway.requestJobStatus(testingTimeout).get()
== JobStatus.RUNNING,
Deadline.fromNow(TimeUtils.toDuration(testingTimeout)));

jobMasterGateway.disconnectTaskManager(
unresolvedTaskManagerLocation.getResourceID(),
new FlinkException("Test exception."));
Expand All @@ -1965,7 +1969,6 @@ public void testJobMasterAcceptsExcessSlotsWhenJobIsRestarting() throws Exceptio
== JobStatus.RESTARTING,
Deadline.fromNow(TimeUtils.toDuration(testingTimeout)));

final int numberSlots = 3;
assertThat(
registerSlotsAtJobMaster(
numberSlots,
Expand Down

0 comments on commit 2317ab4

Please sign in to comment.