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

GenericTestUtils can exceed maxSleepTime

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.0
    • Component/s: None
    • Labels:
      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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: