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

TestLeaseRenewer#testThreadName flakes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.0-beta, 3.0.0-alpha1
    • 2.1.0-beta
    • test
    • None
    • 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-2.patch
          2 kB
          Andrew Wang
        2. hdfs-4751-1.patch
          1 kB
          Andrew Wang

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: