test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java
changeset 57598 80ba2f1cdd4d
parent 54031 feea57b38a1c
equal deleted inserted replaced
57597:ec78fddafd88 57598:80ba2f1cdd4d
    25 import jdk.test.lib.process.*;
    25 import jdk.test.lib.process.*;
    26 
    26 
    27 /*
    27 /*
    28  * @test TestAbortVMOnSafepointTimeout
    28  * @test TestAbortVMOnSafepointTimeout
    29  * @summary Check if VM can kill thread which doesn't reach safepoint.
    29  * @summary Check if VM can kill thread which doesn't reach safepoint.
    30  * @bug 8219584
    30  * @bug 8219584 8227528
    31  * @requires vm.compiler2.enabled
    31  * @requires vm.compiler2.enabled
    32  * @library /test/lib
    32  * @library /test/lib
    33  * @modules java.base/jdk.internal.misc
    33  * @modules java.base/jdk.internal.misc
    34  *          java.management
    34  *          java.management
    35  */
    35  */
    56         }
    56         }
    57         return sum;
    57         return sum;
    58     }
    58     }
    59 
    59 
    60     public static void testWith(int sfpt_interval, int timeout_delay) throws Exception {
    60     public static void testWith(int sfpt_interval, int timeout_delay) throws Exception {
       
    61         // -XX:-UseCountedLoopSafepoints - is used to prevent the loop
       
    62         // in test_loop() to poll for safepoints.
       
    63         // -XX:LoopStripMiningIter=0 and -XX:LoopUnrollLimit=0 - are
       
    64         // used to prevent optimizations over the loop in test_loop()
       
    65         // since we actually want it to provoke a safepoint timeout.
       
    66         // -XX:-UseBiasedLocking - is used to prevent biased locking
       
    67         // handshakes from changing the timing of this test.
    61         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
    68         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
    62                 "-XX:+UnlockDiagnosticVMOptions",
    69                 "-XX:+UnlockDiagnosticVMOptions",
       
    70                 "-XX:-UseBiasedLocking",
    63                 "-XX:+SafepointTimeout",
    71                 "-XX:+SafepointTimeout",
    64                 "-XX:+SafepointALot",
    72                 "-XX:+SafepointALot",
    65                 "-XX:+AbortVMOnSafepointTimeout",
    73                 "-XX:+AbortVMOnSafepointTimeout",
    66                 "-XX:SafepointTimeoutDelay=" + timeout_delay,
    74                 "-XX:SafepointTimeoutDelay=" + timeout_delay,
    67                 "-XX:GuaranteedSafepointInterval=" + sfpt_interval,
    75                 "-XX:GuaranteedSafepointInterval=" + sfpt_interval,