8370797: Test runtime/ErrorHandling/AccessZeroNKlassHitsProtectionZone.java failed on macos 26

Reviewed-by: stuefe, kvn
This commit is contained in:
Ioi Lam 2025-10-29 18:40:14 +00:00
parent 436dc687ba
commit 6080ccd232
2 changed files with 27 additions and 2 deletions

View File

@ -142,7 +142,11 @@ public class AccessZeroNKlassHitsProtectionZone {
for (forceBase = start; forceBase < end; forceBase += step) {
String thisBaseString = String.format("0x%016X", forceBase).toLowerCase();
output = run_test(COH, CDS, thisBaseString);
if (output.contains("CompressedClassSpaceBaseAddress=" + thisBaseString + " given, but reserving class space failed.")) {
if (output.contains("CompressedClassSpaceBaseAddress=" + thisBaseString + " given, but reserving class space failed.") ||
output.matches ("CompressedClassSpaceBaseAddress=" + thisBaseString + " given with shift .*, cannot be used to encode class pointers")) {
// possible output:
// CompressedClassSpaceBaseAddress=0x0000000c00000000 given, but reserving class space failed.
// CompressedClassSpaceBaseAddress=0x0000000d00000000 given with shift 6, cannot be used to encode class pointers
// try next one
} else if (output.contains("Successfully forced class space address to " + thisBaseString)) {
break;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2025, 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
@ -354,6 +354,27 @@ public final class OutputAnalyzer {
return this;
}
/**
* Returns true if stdout matches the given pattern
*/
public boolean stdoutMatches(String regexp) {
return getStdout().matches(regexp);
}
/**
* Returns true if stderr matches the given pattern
*/
public boolean stderrMatches(String regexp) {
return getStderr().matches(regexp);
}
/**
* Returns true if either stdout or stderr matches the given pattern
*/
public boolean matches(String regexp) {
return stdoutMatches(regexp) || stderrMatches(regexp);
}
/**
* Verify that the stdout and stderr contents of output buffer matches
* the pattern