Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit

Permalink
8239557: [TESTBUG] VeryEarlyAssertTest.java validating "END." marker …
Browse files Browse the repository at this point in the history
…at lastline is not always true

Reviewed-by: dholmes, mseledtsov
  • Loading branch information
Fairoz Matte committed Feb 25, 2020
1 parent 5a7b586 commit 956e20e
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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.");
Expand All @@ -114,5 +115,3 @@ public static void main(String[] args) throws Exception {
}

}


0 comments on commit 956e20e

Please sign in to comment.