Skip to content

Commit

Permalink
8218128: vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted003 and 0…
Browse files Browse the repository at this point in the history
…04 use wrong path to test classes

Backport-of: c986cef
  • Loading branch information
RealCLanger committed Jul 19, 2022
1 parent 5e1ce54 commit 2dc4088
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 11 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 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
Expand All @@ -26,6 +26,8 @@
import java.io.FileInputStream;
import java.io.PrintStream;
import java.security.ProtectionDomain;
import java.util.regex.Pattern;
import java.util.regex.Matcher;

import nsk.share.Consts;
import nsk.share.test.Stresser;
Expand Down Expand Up @@ -77,12 +79,20 @@ static byte[] fileBytes(String fileName) {


public static int run(String args[], PrintStream out) {
if ( args == null || args.length < 1 ) {
System.err.println("TEST BUG: Classes directory should be the first argument. Check .cfg file.");
String testclasspath = System.getProperty("test.class.path");
String [] testpaths = testclasspath.split(System.getProperty("path.separator"));
String classesDir = "";

Pattern pattern = Pattern.compile("^(.*)classes(.*)vmTestbase(.*)$");
for (int i = 0 ; i < testpaths.length; i++) {
if (pattern.matcher(testpaths[i]).matches()) {
classesDir = testpaths[i];
}
}
if (classesDir.equals("")) {
System.err.println("TEST BUG: Classes directory not found in test,class.path.");
return Consts.TEST_FAILED;
}

String classesDir = args[0];
Stresser stress = new Stresser(args);

String className = Helper.class.getName();
Expand Down
@@ -0,0 +1,24 @@
#
# Copyright (c) 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

exclusiveAccess.dirs=.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 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
Expand Down Expand Up @@ -45,6 +45,5 @@
* -XX:MaxMetaspaceSize=9m
* -XX:-UseGCOverheadLimit
* nsk.jvmti.ResourceExhausted.resexhausted003
* ../../classes/0/vmTestbase
*/

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 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
Expand Down Expand Up @@ -39,14 +39,12 @@
* @library /vmTestbase
* /test/lib
* @run driver jdk.test.lib.FileInstaller . .
* @ignore 7013634 6606767
* @run main/othervm/native
* -agentlib:resexhausted=-waittime=5
* -Xms16m
* -Xmx16m
* -XX:MaxMetaspaceSize=8m
* -XX:MaxMetaspaceSize=9m
* -XX:-UseGCOverheadLimit
* nsk.jvmti.ResourceExhausted.resexhausted004
* ./bin/classes
*/

1 comment on commit 2dc4088

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.