< prev index next >

test/hotspot/jtreg/gc/shenandoah/TestEvilSyncBug.java

Print this page
*** 1,7 ***
--- 1,8 ---
  /*
   * Copyright (c) 2016, 2020, Red Hat, Inc. All rights reserved.
+  * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

*** 21,17 ***
   * questions.
   *
   */
  
  /*
!  * @test
   * @summary Tests for crash/assert when attaching init thread during shutdown
   * @requires vm.gc.Shenandoah
   * @library /test/lib
   * @modules java.base/jdk.internal.misc
   *          java.management
!  * @run driver/timeout=480 TestEvilSyncBug
   */
  
  import java.util.*;
  import java.util.concurrent.*;
  import java.util.concurrent.locks.*;
--- 22,27 ---
   * questions.
   *
   */
  
  /*
!  * @test id=default
   * @summary Tests for crash/assert when attaching init thread during shutdown
   * @requires vm.gc.Shenandoah
   * @library /test/lib
   * @modules java.base/jdk.internal.misc
   *          java.management
!  * @run driver/timeout=480 TestEvilSyncBug -XX:ShenandoahGCHeuristics=aggressive
+  */
+ 
+ /*
+  * @test id=generational
+  * @summary Tests for crash/assert when attaching init thread during shutdown
+  * @requires vm.gc.Shenandoah
+  * @library /test/lib
+  * @modules java.base/jdk.internal.misc
+  *          java.management
+  * @run driver/timeout=480 TestEvilSyncBug -XX:ShenandoahGCMode=generational
   */
  
  import java.util.*;
  import java.util.concurrent.*;
  import java.util.concurrent.locks.*;

*** 44,13 ***
      private static final int NUM_RUNS = 100;
  
      static Thread[] hooks = new MyHook[10000];
  
      public static void main(String[] args) throws Exception {
!         if (args.length > 0) {
              test();
          } else {
              // Use 1/4 of available processors to avoid over-saturation.
              int numJobs = Math.max(1, Runtime.getRuntime().availableProcessors() / 4);
              ExecutorService pool = Executors.newFixedThreadPool(numJobs);
              Future<?>[] fs = new Future<?>[NUM_RUNS];
  
--- 55,14 ---
      private static final int NUM_RUNS = 100;
  
      static Thread[] hooks = new MyHook[10000];
  
      public static void main(String[] args) throws Exception {
!         if ("test".equals(args[0])) {
              test();
          } else {
+             String options = args[0];
              // Use 1/4 of available processors to avoid over-saturation.
              int numJobs = Math.max(1, Runtime.getRuntime().availableProcessors() / 4);
              ExecutorService pool = Executors.newFixedThreadPool(numJobs);
              Future<?>[] fs = new Future<?>[NUM_RUNS];
  

*** 59,11 ***
                      OutputAnalyzer output = ProcessTools.executeLimitedTestJava("-Xms128m",
                              "-Xmx128m",
                              "-XX:+UnlockExperimentalVMOptions",
                              "-XX:+UnlockDiagnosticVMOptions",
                              "-XX:+UseShenandoahGC",
!                             "-XX:ShenandoahGCHeuristics=aggressive",
                              "TestEvilSyncBug", "test");
                      output.shouldHaveExitValue(0);
                      return null;
                  };
                  fs[c] = pool.submit(task);
--- 71,11 ---
                      OutputAnalyzer output = ProcessTools.executeLimitedTestJava("-Xms128m",
                              "-Xmx128m",
                              "-XX:+UnlockExperimentalVMOptions",
                              "-XX:+UnlockDiagnosticVMOptions",
                              "-XX:+UseShenandoahGC",
!                             options,
                              "TestEvilSyncBug", "test");
                      output.shouldHaveExitValue(0);
                      return null;
                  };
                  fs[c] = pool.submit(task);
< prev index next >