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

Race condition in ThenComposeExceptionTest.java

    XMLWordPrintable

Details

    Backports

      Description

        There is a race condition in the test java/util/concurrent/CompletableFuture/ThenComposeExceptionTest.java, where the setting of the value in an AtomicReference may occur after the assertion checking that value.

        This is more likely to manifest with the VM options:

                -d64 -Xcomp -server -d64 -XX:MaxRAMFraction=8 -XX:+CreateMinidumpOnCrash -ea -esa -XX:+TieredCompilation -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+AggressiveOpts -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops


        ----------System.out:(47/3633)----------
        [TestNG] Running:
          java/util/concurrent/CompletableFuture/ThenComposeExceptionTest.java

        test ThenComposeExceptionTest.testThenCompose("thenCompose and completeExceptionally", ThenComposeExceptionTest$$Lambda$4/727334714@75669bce, ThenComposeExceptionTest$$Lambda$1/1619870038@1ee12b96, ThenComposeExceptionTest$$Lambda$3/127442007@c009aaa): success
        test ThenComposeExceptionTest.testThenCompose("thenComposeAsync and completeExceptionally", ThenComposeExceptionTest$$Lambda$4/727334714@75669bce, ThenComposeExceptionTest$$Lambda$2/247747923@7aff76da, ThenComposeExceptionTest$$Lambda$3/127442007@c009aaa): failure
        java.lang.AssertionError: Incorrect exception reported on whenComplete expected [true] but found [false]
        at org.testng.Assert.fail(Assert.java:94)
        at org.testng.Assert.failNotEquals(Assert.java:494)
        at org.testng.Assert.assertTrue(Assert.java:42)
        at ThenComposeExceptionTest.testThenCompose(ThenComposeExceptionTest.java:107)

        Attachments

          Issue Links

            Activity

              People

                psandoz Paul Sandoz
                dlong Dean Long
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: