Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-15338 Java 11 runtime support
  3. HADOOP-16503

[JDK11] TestLeafQueue tests are failing due to WrongTypeOfReturnValue

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 3.2.0
    • None
    • None
    • None

    Description

      Many of the tests in org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestLeafQueue fails with the following error message running on JDK11:

      [ERROR] testSingleQueueWithOneUser(org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestLeafQueue)  Time elapsed: 0.204 s  <<< ERROR!
      org.mockito.exceptions.misusing.WrongTypeOfReturnValue:
      
      YarnConfiguration cannot be returned by getRMNodes()
      getRMNodes() should return ConcurrentMap
      ***
      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.
      
      	at org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestLeafQueue.setUpInternal(TestLeafQueue.java:221)
      	at org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.TestLeafQueue.setUp(TestLeafQueue.java:144)
             ...
      

      This is due to the actual execution of the call, while we need to record only the invocation of it. According to the javadocs and other folks.

      Attachments

        1. HADOOP-16503.001.patch
          3 kB
          Adam Antal
        2. HADOOP-16503.002.patch
          2 kB
          Kinga Marton
        3. HADOOP-16503.003.patch
          3 kB
          Kinga Marton

        Issue Links

          Activity

            People

              kmarton Kinga Marton
              adam.antal Adam Antal
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: