Skip to content
Permalink
Browse files
8272168: some hotspot runtime/logging tests don't check exit code
Reviewed-by: jiefu
  • Loading branch information
iignatev committed Aug 10, 2021
1 parent abdc107 commit 3b899ef7ffd87477ac1b10f4334b127597e9fe32
Showing 5 changed files with 16 additions and 4 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2021, 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
@@ -45,6 +45,7 @@ public static void main(String... args) throws Exception {
"-Xmx128m",
"BadMap50");
OutputAnalyzer out = new OutputAnalyzer(pb.start());
out.shouldNotHaveExitValue(0);
out.shouldContain("Start class verification for:");
out.shouldContain("End class verification for:");
out.shouldContain("Initializing");
@@ -69,6 +70,7 @@ public static void main(String... args) throws Exception {
"-Xmx128m",
"BadMap50");
out = new OutputAnalyzer(pb.start());
out.shouldNotHaveExitValue(0);
out.shouldNotContain("[class,init]");
out.shouldNotContain("Fail over class verification to old verifier for: BadMap50");

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2021, 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
@@ -62,6 +62,7 @@ public static void main(String... args) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:class+resolve=debug",
ClassResolutionTestMain.class.getName());
OutputAnalyzer o = new OutputAnalyzer(pb.start());
o.shouldHaveExitValue(0);
o.shouldContain("[class,resolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1");
o.shouldContain("[class,resolve] resolve JVM_CONSTANT_MethodHandle");

@@ -70,6 +71,7 @@ public static void main(String... args) throws Exception {
"-Xlog:class+resolve=off",
ClassResolutionTestMain.class.getName());
o = new OutputAnalyzer(pb.start());
o.shouldHaveExitValue(0);
o.shouldNotContain("[class,resolve]");
};

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021, 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
@@ -42,6 +42,7 @@ public static void main(String... args) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:methodhandles",
"CondyIndy");
OutputAnalyzer o = new OutputAnalyzer(pb.start());
o.shouldHaveExitValue(0);
o.shouldContain("[info][methodhandles");
o.shouldNotContain("[debug][methodhandles,indy");
o.shouldNotContain("[debug][methodhandles,condy");
@@ -50,6 +51,7 @@ public static void main(String... args) throws Exception {
pb = ProcessTools.createJavaProcessBuilder("-Xlog:methodhandles+condy=debug",
"CondyIndy");
o = new OutputAnalyzer(pb.start());
o.shouldHaveExitValue(0);
o.shouldNotContain("[info ][methodhandles");
o.shouldNotContain("[debug][methodhandles,indy");
o.shouldContain("[debug][methodhandles,condy");
@@ -58,6 +60,7 @@ public static void main(String... args) throws Exception {
pb = ProcessTools.createJavaProcessBuilder("-Xlog:methodhandles+indy=debug",
"CondyIndy");
o = new OutputAnalyzer(pb.start());
o.shouldHaveExitValue(0);
o.shouldNotContain("[info ][methodhandles");
o.shouldContain("[debug][methodhandles,indy");
o.shouldNotContain("[debug][methodhandles,condy");
@@ -68,6 +71,7 @@ public static void main(String... args) throws Exception {
"-Xlog:methodhandles+indy=debug",
"CondyIndy");
o = new OutputAnalyzer(pb.start());
o.shouldHaveExitValue(0);
o.shouldContain("[info ][methodhandles");
o.shouldContain("[debug][methodhandles,indy");
o.shouldContain("[debug][methodhandles,condy");
@@ -69,11 +69,13 @@ public static void main(String... args) throws Exception {
// -Xlog:class+loader+constraints=info
pb = exec("-Xlog:class+loader+constraints=info");
out = new OutputAnalyzer(pb.start());
out.shouldHaveExitValue(0);
out.shouldContain("[class,loader,constraints] adding new constraint for name: java/lang/Class, loader[0]: 'app', loader[1]: 'bootstrap'");

// -Xlog:class+loader+constraints=off
pb = exec("-Xlog:class+loader+constraints=off");
out = new OutputAnalyzer(pb.start());
out.shouldHaveExitValue(0);
out.shouldNotContain("[class,loader,constraints]");

}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2021, 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
@@ -44,6 +44,7 @@ public static void main(String... args) throws Exception {
"-Xlog:monitormismatch=info",
"MonitorMismatchHelper");
OutputAnalyzer o = new OutputAnalyzer(pb.start());
o.shouldHaveExitValue(0);
o.shouldContain("[monitormismatch] Monitor mismatch in method");

// monitormismatch should turn off.
@@ -52,6 +53,7 @@ public static void main(String... args) throws Exception {
"-Xlog:monitormismatch=off",
"MonitorMismatchHelper");
o = new OutputAnalyzer(pb.start());
o.shouldHaveExitValue(0);
o.shouldNotContain("[monitormismatch]");
};

3 comments on commit 3b899ef

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 3b899ef Aug 10, 2021

Choose a reason for hiding this comment

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

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 3b899ef Mar 14, 2022

Choose a reason for hiding this comment

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

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 3b899ef Mar 14, 2022

Choose a reason for hiding this comment

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

@GoeLin the backport was successfully created on the branch GoeLin-backport-3b899ef7 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 3b899ef7 from the openjdk/jdk repository.

The commit being backported was authored by Igor Ignatyev on 10 Aug 2021 and was reviewed by Jie Fu.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev GoeLin-backport-3b899ef7:GoeLin-backport-3b899ef7
$ git checkout GoeLin-backport-3b899ef7
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev GoeLin-backport-3b899ef7

Please sign in to comment.