Description
YARN-9784 fixed some concurrency related issues in TestLeafQueue, but not all of them. Occasionally it's still possible to receive an exception from Mockito and the two following stack traces can be observed in the console:
org.mockito.exceptions.misusing.WrongTypeOfReturnValue: Integer cannot be returned by isMultiNodePlacementEnabled() isMultiNodePlacementEnabled() should return boolean *** If you're unsure why you're getting above error read on. Due to the nature of the syntax above problem might occur because: 1. This exception *might* occur in wrongly written multi-threaded tests. Please refer to Mockito FAQ on limitations of concurrency testing. 2. A spy is stubbed using when(spy.foo()).then() syntax. It is safer to stub spies - - with doReturn|Throw() family of methods. More in javadocs for Mockito.spy() method.
or
2020-09-22 14:44:52,584 INFO [main] capacity.TestUtils (TestUtils.java:getMockNode(227)) - node = 127.0.0.3 avail=<memory:8192, vCores:1> 2020-09-22 14:44:52,585 INFO [main] capacity.TestUtils (TestUtils.java:getMockNode(227)) - node = 127.0.0.4 avail=<memory:8192, vCores:1> Exception in thread "ActivitiesManager thread." java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean at org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler$$EnhancerByMockitoWithCGLIB$$272c72c5.isMultiNodePlacementEnabled(<generated>) at org.apache.hadoop.yarn.server.resourcemanager.scheduler.activities.ActivitiesManager.dynamicallyUpdateAppActivitiesMaxQueueLengthIfNeeded(ActivitiesManager.java:266) at org.apache.hadoop.yarn.server.resourcemanager.scheduler.activities.ActivitiesManager.access$500(ActivitiesManager.java:63) at org.apache.hadoop.yarn.server.resourcemanager.scheduler.activities.ActivitiesManager$1.run(ActivitiesManager.java:347) at java.lang.Thread.run(Thread.java:748)
It's probably best to disable ActivitiesManager thread entirely in this test class, there is no need for it.
Attachments
Attachments
Issue Links
- is related to
-
YARN-9784 org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestLeafQueue is flaky
- Resolved
- relates to
-
YARN-10672 All testcases in TestReservations are flaky
- Resolved