8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094
authortschatzl
Fri, 31 Mar 2017 13:22:43 +0200
changeset 46358 10e532e20c7d
parent 46357 5873f29039bb
child 46359 76dd8f312458
8177059: [TESTBUG] gc/g1/TestGCLogMessages.java fails on 32bit arm after changes for JDK-8155094 Summary: Provide a way in the test to check log messages on arbitrary conditions and implement this for this case. Reviewed-by: mchernov, sjohanss
hotspot/test/gc/g1/TestGCLogMessages.java
--- a/hotspot/test/gc/g1/TestGCLogMessages.java	Tue Mar 28 13:33:50 2017 +0200
+++ b/hotspot/test/gc/g1/TestGCLogMessages.java	Fri Mar 31 13:22:43 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/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
@@ -23,7 +23,7 @@
 
 /*
  * @test TestGCLogMessages
- * @bug 8035406 8027295 8035398 8019342 8027959 8048179 8027962 8069330 8076463 8150630 8160055
+ * @bug 8035406 8027295 8035398 8019342 8027959 8048179 8027962 8069330 8076463 8150630 8160055 8177059
  * @summary Ensure the output for a minor GC with G1
  * includes the expected necessary messages.
  * @key gc
@@ -38,6 +38,7 @@
 
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.Platform;
 
 public class TestGCLogMessages {
 
@@ -70,8 +71,22 @@
             this.message = message;
             this.level = level;
         }
+
+        public boolean isAvailable() {
+            return true;
+        }
     };
 
+    private class LogMessageWithLevelC2OrJVMCIOnly extends LogMessageWithLevel {
+        public LogMessageWithLevelC2OrJVMCIOnly(String message, Level level) {
+            super(message, level);
+        }
+
+        public boolean isAvailable() {
+            return Platform.isGraal() || Platform.isServer();
+        }
+    }
+
     private LogMessageWithLevel allLogMessages[] = new LogMessageWithLevel[] {
         new LogMessageWithLevel("Pre Evacuate Collection Set", Level.INFO),
         new LogMessageWithLevel("Evacuate Collection Set", Level.INFO),
@@ -119,13 +134,13 @@
         new LogMessageWithLevel("Prepare TLABs", Level.DEBUG),
         new LogMessageWithLevel("Resize TLABs", Level.DEBUG),
 
-        new LogMessageWithLevel("DerivedPointerTable Update", Level.DEBUG),
+        new LogMessageWithLevelC2OrJVMCIOnly("DerivedPointerTable Update", Level.DEBUG),
         new LogMessageWithLevel("Start New Collection Set", Level.DEBUG),
     };
 
     void checkMessagesAtLevel(OutputAnalyzer output, LogMessageWithLevel messages[], Level level) throws Exception {
         for (LogMessageWithLevel l : messages) {
-            if (level.lessThan(l.level)) {
+            if (level.lessThan(l.level) || !l.isAvailable()) {
                 output.shouldNotContain(l.message);
             } else {
                 output.shouldMatch("\\[" + l.level + ".*" + l.message);