8215901: [TESTBUG] TestCheckedEnsureLocalCapacity.java fails intermittently
Summary: Change pattern match to not require that the matching string start at the beginning of a line.
Reviewed-by: dcubed, dholmes
--- a/test/hotspot/jtreg/runtime/jni/checked/TestCheckedEnsureLocalCapacity.java Wed Jan 09 10:19:54 2019 +0100
+++ b/test/hotspot/jtreg/runtime/jni/checked/TestCheckedEnsureLocalCapacity.java Wed Jan 09 08:07:33 2019 -0500
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, 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
@@ -47,10 +47,13 @@
{ 1, 45 } // bad: copies >> capacity
};
+ // Patterns EXCEED_WARNING and WARNING are not anchored to the beginning
+ // of lines to allow matching interleaved output.
+
private static final String EXCEED_WARNING =
- "^WARNING: JNI local refs: \\d++, exceeds capacity:";
+ "WARNING: JNI local refs: \\d++, exceeds capacity:";
- private static final String WARNING = "^WARNING: ";
+ private static final String WARNING = "WARNING:";
public static void main(String[] args) throws Throwable {
if (args.length == 2) {