On Fri, 31 Oct 2025 19:25:40 GMT, Chris Plummer <[email protected]> wrote:

> There are a number of tests that check that stderr has no output other than 
> deprecation warnings. This is bit overdone and unnecessary. There are command 
> line options such as -XX:+UseLargePages that can result in a warning that has 
> nothing to do with the test. The test should not fail for this reason.
> 
> For the SA tests, the main reason for the stderr check is to catch 
> exceptions, warnings, or errors generated by SA tools on stderr. There is no 
> need to fail if there is a VM warning, so switching to 
> stderrShouldBeEmptyIgnoreVMWarnings() should be fine.
> 
> For the attach test, the test is trying to instigate a failure by deleting 
> the .java_pid files. Before the bug fix that this test was added for, the 
> jcmd tool would get a com.sun.tools.attach.AttachNotSupportedException and 
> print it on stderr, and also result in an exit value of 1. The test already 
> checks the exit value, so this should be sufficient, but there is no harm in 
> also checking stderr assuming we allow VM warnings, so this test is also 
> switching to stderrShouldBeEmptyIgnoreVMWarnings().
> 
> Tested by running all affected tests with -XX:+UseLargePages on hosts that 
> produce a warning message when you do this.

This pull request has now been integrated.

Changeset: b0536f9c
Author:    Chris Plummer <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/b0536f9c2a6ddfa27be8fad8f53783c6b28d22c9
Stats:     8 lines in 5 files changed: 0 ins; 0 del; 8 mod

8370201: Test serviceability/sa/TestJhsdbJstackWithVirtualThread.java fails due 
to VM warnings

Reviewed-by: kevinw, amenkov, sspitsyn

-------------

PR: https://git.openjdk.org/jdk/pull/28091

Reply via email to