Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-10666 Über-jira: Unit tests should not use fixed sleep interval to wait for conditions
  3. HDFS-10284

o.a.h.hdfs.server.blockmanagement.TestBlockManagerSafeMode.testCheckSafeMode fails intermittently

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.9.0
    • Fix Version/s: 2.9.0, 3.0.0-alpha1
    • Component/s: test
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      Stacktrace

      org.mockito.exceptions.misusing.UnfinishedStubbingException: 
      Unfinished stubbing detected here:
      -> at org.apache.hadoop.hdfs.server.blockmanagement.TestBlockManagerSafeMode.testCheckSafeMode(TestBlockManagerSafeMode.java:169)
      
      E.g. thenReturn() may be missing.
      Examples of correct stubbing:
          when(mock.isOk()).thenReturn(true);
          when(mock.isOk()).thenThrow(exception);
          doThrow(exception).when(mock).someVoidMethod();
      Hints:
       1. missing thenReturn()
       2. although stubbed methods may return mocks, you cannot inline mock creation (mock()) call inside a thenReturn method (see issue 53)
      
      	at org.apache.hadoop.hdfs.server.blockmanagement.TestBlockManagerSafeMode.testCheckSafeMode(TestBlockManagerSafeMode.java:169)
      

      Sample failing pre-commit UT: https://builds.apache.org/job/PreCommit-HDFS-Build/15153/testReport/org.apache.hadoop.hdfs.server.blockmanagement/TestBlockManagerSafeMode/testCheckSafeMode/

        Attachments

        1. HDFS-10284.000.patch
          5 kB
          Mingliang Liu
        2. HDFS-10284.001.patch
          5 kB
          Mingliang Liu
        3. HDFS-10284.002.patch
          5 kB
          Mingliang Liu
        4. HDFS-10284.003.patch
          5 kB
          Mingliang Liu

          Issue Links

            Activity

              People

              • Assignee:
                liuml07 Mingliang Liu
                Reporter:
                liuml07 Mingliang Liu
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: