8366941: Excessive logging in serviceability tests causes timeout

Reviewed-by: lmesnik, sspitsyn
This commit is contained in:
Ioi Lam 2025-09-20 17:26:07 +00:00
parent b03b6f54c5
commit d21e73dee3
3 changed files with 7 additions and 7 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2025, 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
@ -36,7 +36,7 @@ import jdk.test.lib.process.OutputAnalyzer;
public class TestBasicLogOutput {
public static void main(String[] args) throws Exception {
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:all=trace", "-version");
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:all=info", "-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldMatch("\\[logging *\\]"); // expected tag(s)
output.shouldContain("Log configuration fully initialized."); // expected message

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2025, 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
@ -64,7 +64,7 @@ public class TestFullNames {
Asserts.assertFalse(file.exists());
// Run with logging=trace on stdout so that we can verify the log configuration afterwards.
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:logging=trace",
"-Xlog:all=trace:" + logOutput,
"-Xlog:all=info:" + logOutput,
"-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldHaveExitValue(0);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2025, 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
@ -74,7 +74,7 @@ public class TestQuotedLogOutputs {
for (String logOutput : validOutputs) {
// Run with logging=trace on stdout so that we can verify the log configuration afterwards.
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:logging=trace",
"-Xlog:all=trace:" + logOutput,
"-Xlog:all=info:" + logOutput,
"-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldHaveExitValue(0);
@ -99,7 +99,7 @@ public class TestQuotedLogOutputs {
};
for (String logOutput : invalidOutputs) {
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:logging=trace",
"-Xlog:all=trace:" + logOutput,
"-Xlog:all=info:" + logOutput,
"-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldHaveExitValue(1);