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:
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.
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
It's probably best to disable ActivitiesManager thread entirely in this test class, there is no need for it.