tillrohrmann commented on a change in pull request #11353:
URL: https://github.com/apache/flink/pull/11353#discussion_r411413787



##########
File path: 
flink-yarn/src/test/java/org/apache/flink/yarn/YarnResourceManagerTest.java
##########
@@ -243,24 +248,33 @@ protected NMClientAsync 
createAndStartNodeManagerClient(YarnConfiguration yarnCo
 
                // domain objects for test purposes
                final ResourceProfile resourceProfile1 = 
ResourceProfile.UNKNOWN;
+               final WorkerResourceSpec workerResourceSpec;
+
+               final Resource containerResource;
 
                public String taskHost = "host1";
 
                final TestingYarnNMClientAsync testingYarnNMClientAsync;
 
                final TestingYarnAMRMClientAsync testingYarnAMRMClientAsync;
 
+               int containerIdx = 0;
+
                /**
                 * Create mock RM dependencies.
                 */
                Context() throws Exception {
-                       this(flinkConfig);
+                       this(flinkConfig, null);
                }
 
-               Context(Configuration configuration) throws  Exception {
-                       final SlotManager slotManager = 
SlotManagerBuilder.newBuilder()
-                               
.setDefaultWorkerResourceSpec(YarnWorkerResourceSpecFactory.INSTANCE.createDefaultWorkerResourceSpec(configuration))
-                               .build();
+               Context(Configuration configuration, @Nullable SlotManager 
slotManager) throws  Exception {
+
+                       workerResourceSpec = 
YarnWorkerResourceSpecFactory.INSTANCE.createDefaultWorkerResourceSpec(configuration);
+                       if (slotManager == null) {
+                               slotManager = SlotManagerBuilder.newBuilder()
+                                       
.setDefaultWorkerResourceSpec(workerResourceSpec)
+                                       .build();
+                       }

Review comment:
       I think it would be fine to add a 
`SlotManager.getDefaultWorkerResourceSpec()`. This could solve the problem here.




----------------------------------------------------------------
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]


Reply via email to