Skip to content

Commit

Permalink
8314830: runtime/ErrorHandling/ tests ignore external VM flags
Browse files Browse the repository at this point in the history
Reviewed-by: dholmes, lmesnik
  • Loading branch information
Mikhailo Seledtsov authored and pull[bot] committed Apr 16, 2024
1 parent 3204cb4 commit 8296374
Show file tree
Hide file tree
Showing 24 changed files with 48 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2023, 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 @@ -35,6 +35,7 @@
* @bug 8194652
* @summary Printing native stack shows an "error occurred during error reporting".
* @modules java.base/jdk.internal.misc
* @requires vm.flagless
* @requires vm.debug
* @requires vm.flavor != "zero"
* @library /test/lib
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2022, 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 @@ -25,6 +25,7 @@
* @test
* @bug 8271003
* @summary CLASSPATH env variable setting should not be truncated in a hs err log.
* @requires vm.flagless
* @requires vm.debug
* @library /test/lib
* @run driver ClassPathEnvVar
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, SAP. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -30,6 +30,7 @@
* in the error file name)
* @library /test/lib
* @modules java.base/jdk.internal.misc
* @requires vm.flagless
* @requires (vm.debug == true)
* @run driver ErrorFileOverwriteTest
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, SAP. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -29,6 +29,7 @@
* @summary Test ErrorFileToStderr and ErrorFileToStdout
* @library /test/lib
* @modules java.base/jdk.internal.misc
* @requires vm.flagless
* @requires (vm.debug == true)
* @run driver ErrorFileRedirectTest
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2023, 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 @@ -24,6 +24,7 @@
/*
* @test
* @bug 8272586
* @requires vm.flagless
* @requires vm.compiler2.enabled
* @summary Test that abstract machine code is dumped for the top frames in a hs-err log
* @library /test/lib
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2023, 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 @@ -33,6 +33,7 @@

/*
* @test
* @requires vm.flagless
* @requires (vm.debug == true)
* @bug 8167108
* @summary Nested ThreadsListHandle info should be in error handling output.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2023, 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 @@ -30,6 +30,7 @@
* java.compiler
* java.management
* jdk.internal.jvmstat/sun.jvmstat.monitor
* @requires vm.flagless
* @run driver ProblematicFrameTest
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* @test
* @summary Check secondary error handling
* @library /test/lib
* @requires vm.flagless
* @requires vm.debug
* @requires os.family != "windows"
* @modules java.base/jdk.internal.misc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2023, 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 @@ -27,6 +27,7 @@
* @bug 8284274
* @summary Test that reporting doesn't crash because missing ResourceMarks
* @library /test/lib
* @requires vm.flagless
* @requires vm.debug
* @requires os.family != "windows"
* @modules java.base/jdk.internal.misc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2015, 2022 SAP SE. All rights reserved.
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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 @@ -37,6 +37,7 @@
* @summary SafeFetch32 and SafeFetchN do not work in error handling
* @modules java.base/jdk.internal.misc
* @library /test/lib
* @requires vm.flagless
* @requires vm.debug
* @requires vm.flavor != "zero"
* @author Thomas Stuefe (SAP)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2014, 2022 SAP SE. All rights reserved.
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2023, 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 @@ -27,6 +27,7 @@
* @test
* @summary Check secondary error handling
* @library /test/lib
* @requires vm.flagless
* @requires vm.debug
* @requires os.family != "windows"
* @modules java.base/jdk.internal.misc
Expand All @@ -38,6 +39,7 @@
* @test
* @summary Check secondary error handling
* @library /test/lib
* @requires vm.flagless
* @requires vm.debug
* @requires os.family != "windows"
* @modules java.base/jdk.internal.misc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* @bug 8191101
* @summary Show Registers on assert/guarantee
* @library /test/lib
* @requires vm.flagless
* @requires (vm.debug == true) & (os.family == "linux")
* @author Thomas Stuefe (SAP)
* @modules java.base/jdk.internal.misc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* @test TestAbortVmOnException
* @summary Test -XX:AbortVMOnException=MyAbortException with C1 compilation
* @library /test/lib
* @requires vm.flagless
* @run driver TestAbortVmOnException
* @bug 8264899
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* @summary Test using -XX:+CrashOnOutOfMemoryError
* @modules java.base/jdk.internal.misc
* @library /test/lib
* @requires vm.flagless
* @run driver TestCrashOnOutOfMemoryError
* @bug 8138745
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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,7 @@
* @summary Test using -XX:ExitOnOutOfMemoryError
* @modules java.base/jdk.internal.misc
* @library /test/lib
* @requires vm.flagless
* @run driver TestExitOnOutOfMemoryError
* @bug 8138745
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2021 SAP SE. All rights reserved.
* Copyright (c) 2023, 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 @@ -32,6 +33,7 @@
* @test
* @summary Test verifies that -XX:HeapDumpGzipLevel=1 works
* @library /test/lib
* @requires vm.flagless
* @run driver/timeout=240 TestGZippedHeapDumpOnOutOfMemoryError run 1
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2023, 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 @@ -25,13 +25,15 @@
* @test TestHeapDumpOnOutOfMemoryError
* @summary Test verifies that -XX:HeapDumpOnOutOfMemoryError dumps heap when OutOfMemory is thrown in heap
* @library /test/lib
* @requires vm.flagless
* @run driver TestHeapDumpOnOutOfMemoryError run heap
*/

/*
* @test TestHeapDumpOnOutOfMemoryError
* @summary Test verifies that -XX:HeapDumpOnOutOfMemoryError dumps heap when OutOfMemory is thrown in metaspace.
* @library /test/lib
* @requires vm.flagless
* @run driver/timeout=240 TestHeapDumpOnOutOfMemoryError run metaspace
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2023, 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 @@ -25,6 +25,7 @@
* @test TestHeapDumpPath
* @summary Test verifies that -XX:HeapDumpPath= supports directory as a parameter.
* @library /test/lib
* @requires vm.flagless
* @run driver TestHeapDumpPath
*/

Expand Down
3 changes: 2 additions & 1 deletion test/hotspot/jtreg/runtime/ErrorHandling/TestOnError.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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 @@ -27,6 +27,7 @@
* @summary Test using -XX:OnError=<cmd>
* @modules java.base/jdk.internal.misc
* @library /test/lib
* @requires vm.flagless
* @requires vm.debug
* @run driver TestOnError
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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,7 @@
* @summary Test using single and multiple -XX:OnOutOfMemoryError=<cmd>
* @modules java.base/jdk.internal.misc
* @library /test/lib
* @requires vm.flagless
* @run driver TestOnOutOfMemoryError
* @bug 8078470 8177522
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -27,6 +27,7 @@
* @test segv
* @summary Test that for a given crash situation we see the correct siginfo in the hs-err file
* @library /test/lib
* @requires vm.flagless
* @requires vm.debug
* @requires os.family != "windows"
* @modules java.base/jdk.internal.misc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2023, 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 @@ -38,6 +38,7 @@
* @summary ThreadsListHandle info should be in error handling output.
* @modules java.base/jdk.internal.misc
* @library /test/lib
* @requires vm.flagless
* @run driver ThreadsListHandleInErrorHandlingTest
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2017, 2022 SAP SE. All rights reserved.
* Copyright (c) 2023, Red Hat, Inc. and/or its affiliates.
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2023, 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 @@ -42,6 +42,7 @@
* @summary Hanging Error Reporting steps may lead to torn error logs
* @modules java.base/jdk.internal.misc
* @library /test/lib
* @requires vm.flagless
* @requires (vm.debug == true) & (os.family != "windows")
* @run driver TimeoutInErrorHandlingTest
* @author Thomas Stuefe (SAP)
Expand All @@ -53,6 +54,7 @@
* @summary Error handling step timeouts should never be blocked by OnError etc.
* @modules java.base/jdk.internal.misc
* @library /test/lib
* @requires vm.flagless
* @requires (vm.debug == true) & (os.family != "windows")
* @run driver TimeoutInErrorHandlingTest with-on-error
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2022 SAP. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -29,6 +29,7 @@
* @summary No hs-err file if fatal error is raised during dynamic initialization.
* @library /test/lib
* @modules java.base/jdk.internal.misc
* @requires vm.flagless
* @requires (vm.debug == true)
* @requires os.family == "linux"
* @run driver VeryEarlyAssertTest
Expand All @@ -49,8 +50,7 @@ public class VeryEarlyAssertTest {
public static void main(String[] args) throws Exception {


ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
"-version");
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-version");
Map<String, String> env = pb.environment();
env.put("HOTSPOT_FATAL_ERROR_DURING_DYNAMIC_INITIALIZATION", "1");

Expand Down

0 comments on commit 8296374

Please sign in to comment.