Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-15316

GenericTestUtils can exceed maxSleepTime

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • None
    • 3.2.0
    • None
    • None

    Description

      Probably shouldn't ever cause an issue, especially since Thread.sleep() can cause longer delays beyond your control anyway, but for larger values this could still behave unpredicatably in practice.

      Thread.sleep(r.nextInt(maxSleepTime) + minSleepTime);
      

      should be

      Thread.sleep(r.nextInt(maxSleepTime - minSleepTime) + minSleepTime)

       

      Attachments

        1. HADOOP-15316.001.patch
          0.8 kB
          Adam Antal

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            adam.antal Adam Antal
            mackrorysd Sean Mackrory
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment