slfan1989 commented on code in PR #8779:
URL: https://github.com/apache/hadoop/pull/8779#discussion_r4171678048
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestLeafQueue.java:
##########
@@ -5245,8 +5245,8 @@ private ApplicationAttemptId createAppAttemptId(int
appId, int attemptId) {
public void testMaxApplicationsWithNodeLabels() throws IOException {
CapacitySchedulerConfiguration conf = csConf;
String rootChild = root.getChildQueues().get(0).getQueuePath();
- when(cs.getClusterResource()).thenReturn(
- Resources.createResource(2 * 16 * GB, 2 * 32));
+ cs.getNodeTracker().addNode(
Review Comment:
The change replaces stubbing `cs.getClusterResource()` after the scheduler
has started with registering a test node in the scheduler’s `NodeTracker`. This
avoids modifying a Mockito spy while background threads are accessing it, which
can cause `WrongTypeOfReturnValue` errors. The cluster resource total and
existing assertions remain unchanged, and the fix affects only test code.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]