8230881: serviceability/sa/TestJmapCore tests fail with java.lang.RuntimeException: Could not find dump file
authorlmesnik
Fri, 13 Sep 2019 09:34:13 -0700
changeset 58127 41082cd965cc
parent 58126 1def54255e93
child 58128 88bbe06ab8d6
8230881: serviceability/sa/TestJmapCore tests fail with java.lang.RuntimeException: Could not find dump file Reviewed-by: dholmes, cjplummer
test/hotspot/jtreg/serviceability/sa/TestJmapCore.java
--- a/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java	Fri Sep 13 11:00:07 2019 +0100
+++ b/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java	Fri Sep 13 09:34:13 2019 -0700
@@ -98,8 +98,8 @@
             : ProcessTools.executeProcess("sh", "-c", "ulimit -c unlimited && "
                     + ProcessTools.getCommandLine(pb));
         File core;
-        String pattern = Platform.isWindows() ? "mdmp" : "core";
-        File[] cores = new File(".").listFiles((dir, name) -> name.contains(pattern));
+        String pattern = Platform.isWindows() ? ".*\\.mdmp" : "core(\\.\\d+)?";
+        File[] cores = new File(".").listFiles((dir, name) -> name.matches(pattern));
         if (cores.length == 0) {
             // /cores/core.$pid might be generated on macosx by default
             String pid = output.firstMatch("^(\\d+)" + pidSeparator, 1);