changeset 60202:d6b968af8b65

8239557: [TESTBUG] VeryEarlyAssertTest.java validating "END." marker at lastline is not always true Reviewed-by: dholmes, mseledtsov
author fmatte
date Mon, 24 Feb 2020 23:44:29 -0500
parents 1c7da538f065
children 22422bef1c5d
files test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java
diffstat 1 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java	Tue Feb 25 10:34:33 2020 +0800
+++ b/test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java	Mon Feb 24 23:44:29 2020 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2018, SAP. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -49,8 +49,6 @@
 
 
     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
-            "-Xmx64M",
-            "-XX:-CreateCoredumpOnCrash",
             "-version");
     Map<String, String> env = pb.environment();
     env.put("HOTSPOT_FATAL_ERROR_DURING_DYNAMIC_INITIALIZATION", "1");
@@ -87,7 +85,7 @@
     };
     int currentPattern = 0;
 
-    String lastLine = null;
+    boolean endMarkerFound = false;
     while ((line = br.readLine()) != null) {
       if (currentPattern < pattern.length) {
         if (pattern[currentPattern].matcher(line).matches()) {
@@ -95,7 +93,10 @@
           currentPattern++;
         }
       }
-      lastLine = line;
+      if (line.equals("END.")) {
+        endMarkerFound = true;
+        break;
+      }
     }
     br.close();
 
@@ -103,7 +104,7 @@
       throw new RuntimeException("hs-err file incomplete (first missing pattern: " + currentPattern + ")");
     }
 
-    if (!lastLine.equals("END.")) {
+    if (!endMarkerFound) {
       throw new RuntimeException("hs-err file incomplete (missing END marker.)");
     } else {
       System.out.println("End marker found.");
@@ -114,5 +115,3 @@
   }
 
 }
-
-