Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8283231

java/lang/Thread/SleepWithDuration.java fails due to not meeting upper bound temporal constraint

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • repo-loom
    • core-libs
    • x86_64
    • windows

      The test fails because the testSleep test fails to meet the 4000msec upper bound constraint of the sleep timeout. This upper bound seems unnecessary, and will be difficult to always satisfy in heavily loaded environment with thousands of threads. It is a quasi real time constraint in a non real time environment, where deadlines can't satisfied.

      ----------System.out:(43/2706)----------
      test SleepWithDuration.testInterruptSleep(): success
      test SleepWithDuration.testSleep(): failure
      java.lang.AssertionError: Duration 4261ms, expected <= 4000ms expected [true] but found [false]
      at org.testng.Assert.fail(Assert.java:99)
      at org.testng.Assert.failNotEquals(Assert.java:1037)
      at org.testng.Assert.assertTrue(Assert.java:45)
      at SleepWithDuration.expectDuration(SleepWithDuration.java:123)
      at SleepWithDuration.testSleep(SleepWithDuration.java:46)

            msheppar Mark Sheppard
            msheppar Mark Sheppard
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: