Skip to content
Permalink
Browse files

8239557: [TESTBUG] VeryEarlyAssertTest.java validating "END." marker …

…at lastline is not always true

Reviewed-by: dholmes, mseledtsov
  • Loading branch information
Fairoz Matte
Fairoz Matte committed Feb 25, 2020
1 parent 5a7b586 commit 956e20ed16709663d9ea62eac764bf7d24a6d3de
Showing with 7 additions and 8 deletions.
  1. +7 −8 test/hotspot/jtreg/runtime/ErrorHandling/VeryEarlyAssertTest.java
@@ -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 @@ public static void main(String[] args) throws Exception {


ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
"-Xmx64M",
"-XX:-CreateCoredumpOnCrash",
"-version");
Map<String, String> env = pb.environment();
env.put("HOTSPOT_FATAL_ERROR_DURING_DYNAMIC_INITIALIZATION", "1");
@@ -87,23 +85,26 @@ public static void main(String[] args) throws Exception {
};
int currentPattern = 0;

String lastLine = null;
boolean endMarkerFound = false;
while ((line = br.readLine()) != null) {
if (currentPattern < pattern.length) {
if (pattern[currentPattern].matcher(line).matches()) {
System.out.println("Found: " + line + ".");
currentPattern++;
}
}
lastLine = line;
if (line.equals("END.")) {
endMarkerFound = true;
break;
}
}
br.close();

if (currentPattern < pattern.length) {
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 @@ public static void main(String[] args) throws Exception {
}

}


0 comments on commit 956e20e

Please sign in to comment.