Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-4751

TestLeaseRenewer#testThreadName flakes

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.0-beta, 3.0.0-alpha1
    • Fix Version/s: 2.1.0-beta
    • Component/s: test
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Seen internally and during upstream trunk builds, error like the following:

      Error Message:
       Unfinished stubbing detected here: -> at org.apache.hadoop.hdfs.TestLeaseRenewer.testThreadName(TestLeaseRenewer.java:197)  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)
      
      Stack Trace:
      org.mockito.exceptions.misusing.UnfinishedStubbingException:
      Unfinished stubbing detected here:
      -> at org.apache.hadoop.hdfs.TestLeaseRenewer.testThreadName(TestLeaseRenewer.java:197)
      

      I believe it's due to mocking while being concurrently accessed by another thread.

        Attachments

        1. hdfs-4751-1.patch
          1 kB
          Andrew Wang
        2. hdfs-4751-2.patch
          2 kB
          Andrew Wang

          Activity

            People

            • Assignee:
              andrew.wang Andrew Wang
              Reporter:
              andrew.wang Andrew Wang
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: