Skip to content

Commit

Permalink
[FLINK-12812] [runtime] (follow-up) Test refers to slot profile compu…
Browse files Browse the repository at this point in the history
…ted in ResourceManager.

This helps catch a previous bug in which the test re-computed the managed memory, passing a test value
in MEGABYTES. The original call in the ResourceManager passed a value in BYTES.
  • Loading branch information
StephanEwen committed Jul 8, 2019
1 parent 21d7503 commit bfd4543
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ Resource getContainerResource() {
return resource;
}

@VisibleForTesting
Collection<ResourceProfile> getSlotsPerWorker() {
return slotsPerWorker;
}

@Override
public boolean stopWorker(final YarnWorkerNode workerNode) {
final Container container = workerNode.getContainer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import org.apache.flink.runtime.metrics.groups.UnregisteredMetricGroups;
import org.apache.flink.runtime.registration.RegistrationResponse;
import org.apache.flink.runtime.resourcemanager.JobLeaderIdService;
import org.apache.flink.runtime.resourcemanager.ResourceManager;
import org.apache.flink.runtime.resourcemanager.ResourceManagerGateway;
import org.apache.flink.runtime.resourcemanager.SlotRequest;
import org.apache.flink.runtime.resourcemanager.slotmanager.SlotManager;
Expand Down Expand Up @@ -564,10 +563,7 @@ private void testCreateSlotsPerWorker(Configuration config, Resource resource) t
new Context(config) {{
runTest(() -> {

ResourceProfile rmCalculatedResourceProfile =
ResourceManager.updateTaskManagerConfigAndCreateWorkerSlotProfiles(
config, resource.getMemory(), config.getInteger(TaskManagerOptions.NUM_TASK_SLOTS))
.iterator().next();
ResourceProfile rmCalculatedResourceProfile = resourceManager.getSlotsPerWorker().iterator().next();

ResourceProfile tmCalculatedResourceProfile =
TaskManagerServices.computeSlotResourceProfile(
Expand Down

0 comments on commit bfd4543

Please sign in to comment.