8142437: SafepointTest.java is occasionally failing in JPRT
authorrprotacio
Wed, 11 Nov 2015 18:04:33 -0500
changeset 34127 ddcf152b170f
parent 34125 56c4a2d19ee1
child 34128 86d333c6f003
8142437: SafepointTest.java is occasionally failing in JPRT Summary: A method compilation causing a specific log message to print has been removed because it was not always being compiled. Reviewed-by: coleenp, dholmes
hotspot/test/runtime/logging/SafepointTest.java
hotspot/test/runtime/logging/SafepointTestMain.java
--- a/hotspot/test/runtime/logging/SafepointTest.java	Wed Nov 11 14:57:27 2015 -0800
+++ b/hotspot/test/runtime/logging/SafepointTest.java	Wed Nov 11 18:04:33 2015 -0500
@@ -41,11 +41,9 @@
             "-Xlog:safepoint=trace", "SafepointTestMain");
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
         output.shouldContain("Safepoint synchronization initiated. (");
-        output.shouldContain(" thread(s) to block");
         output.shouldContain("Entering safepoint region: ");
         output.shouldContain("Leaving safepoint region");
         output.shouldContain("_at_poll_safepoint");
-        output.shouldContain("... found polling page ");
         output.shouldHaveExitValue(0);
     }
 }
--- a/hotspot/test/runtime/logging/SafepointTestMain.java	Wed Nov 11 14:57:27 2015 -0800
+++ b/hotspot/test/runtime/logging/SafepointTestMain.java	Wed Nov 11 18:04:33 2015 -0500
@@ -24,21 +24,6 @@
 import java.lang.ref.WeakReference;
 
 public class SafepointTestMain {
-    public static class B {
-        static int count = 0;
-        public static volatile boolean stop = false;
-        static void localSleep(int time) {
-          try{
-            Thread.currentThread().sleep(time);
-          } catch(InterruptedException ie) {
-          }
-        }
-
-        public static void infinite() {
-            while (!stop) { count++; }
-        }
-    }
-
     public static byte[] garbage;
     public static volatile WeakReference<Object> weakref;
 
@@ -48,16 +33,7 @@
     }
 
     public static void main(String[] args) throws Exception {
-        // Run function in separate thread to force compilation and pint safepoint
-        // message for compiled method
-        new Thread() {
-            public void run() {
-                B.infinite();
-            }
-        }.start();
-        B.localSleep(1000);
-        // Cause several safepoints to run GC while the compiled method is running,
-        // to see safepoint messages
+        // Cause several safepoints to run GC to see safepoint messages
         for (int i = 0; i < 2; i++) {
             createweakref();
             while(weakref.get() != null) {
@@ -65,6 +41,5 @@
                 System.gc();
             }
         }
-        B.stop = true;
     }
 }