Details
-
Bug
-
Resolution: Fixed
-
P3
-
11.0.24-oracle, 19
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8326812 | 21.0.4-oracle | Ramesh Gangadhar | P3 | Resolved | Fixed | b01 |
JDK-8327579 | 21.0.4 | Sonia Zaldana Calles | P3 | Resolved | Fixed | b01 |
Description
junit.framework.AssertionFailedError
at junit.framework.Assert.fail(Assert.java:55)
at junit.framework.Assert.assertTrue(Assert.java:22)
at junit.framework.Assert.assertTrue(Assert.java:31)
at junit.framework.TestCase.assertTrue(TestCase.java:200)
at SystemTest.testNanoTime(SystemTest.java:73)
public void testNanoTime() throws InterruptedException {
long m0 = System.currentTimeMillis();
long n0 = System.nanoTime();
Thread.sleep(1);
long m1 = System.currentTimeMillis();
long n1 = System.nanoTime();
Thread.sleep(50); // avoid possibly scaled SHORT_DELAY_MS
long m2 = System.currentTimeMillis();
long n2 = System.nanoTime();
Thread.sleep(1);
long m3 = System.currentTimeMillis();
long n3 = System.nanoTime();
assertTrue((n2 - n1) / 1_000_000 <= m3 - m0 + MILLIS_ROUND);
assertTrue(m2 - m1 <= (n3 - n0) / 1_000_000 + MILLIS_ROUND);
}
It is the final assertion that is failing.
Platform: macOS x64
The test really should print all the values so they can be examined in case of failures like this.
Attachments
Issue Links
- backported by
-
JDK-8326812 java/util/concurrent/tck/JSR166TestCase.java fails nanoTime test
- Resolved
-
JDK-8327579 java/util/concurrent/tck/JSR166TestCase.java fails nanoTime test
- Resolved
- relates to
-
JDK-8282313 java/util/concurrent/tck/JSR166TestCase.java fails testAwaitQuiescence2 test
- Open
-
JDK-8312622 java/util/concurrent/tck/JSR166TestCase.java fails an unknown test case
- Closed
- links to
-
Commit openjdk/jdk21u-dev/c26cad30
-
Commit openjdk/jdk/54f09d73
-
Review openjdk/jdk21u-dev/331
-
Review openjdk/jdk/17960