From c59e44a7aa2aeff0823830b698d524523b996650 Mon Sep 17 00:00:00 2001 From: Patricio Chilano Mateo Date: Thu, 5 Jun 2025 15:02:02 +0000 Subject: [PATCH] 8357914: TestEmptyBootstrapMethodsAttr.java fails when run with TEST_THREAD_FACTORY=Virtual Reviewed-by: lmesnik, dholmes, sspitsyn, syan --- test/hotspot/jtreg/ProblemList-Virtual.txt | 1 - .../TestEmptyBootstrapMethodsAttr.java | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/test/hotspot/jtreg/ProblemList-Virtual.txt b/test/hotspot/jtreg/ProblemList-Virtual.txt index dbd555c1cdd..4216eddb885 100644 --- a/test/hotspot/jtreg/ProblemList-Virtual.txt +++ b/test/hotspot/jtreg/ProblemList-Virtual.txt @@ -90,7 +90,6 @@ vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended002/TestDescription.ja gc/arguments/TestNewSizeThreadIncrease.java 0000000 generic-all gc/g1/TestSkipRebuildRemsetPhase.java 0000000 generic-all -runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java 8346442 generic-all runtime/ErrorHandling/MachCodeFramesInErrorFile.java 0000000 generic-all runtime/Thread/AsyncExceptionOnMonitorEnter.java 0000000 generic-all runtime/Thread/StopAtExit.java 0000000 generic-all diff --git a/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java b/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java index 53c85d53c44..33d42a31a04 100644 --- a/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java +++ b/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -54,8 +54,13 @@ public class TestEmptyBootstrapMethodsAttr { "-Duser.language=en", "-Duser.country=US", className); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("java.lang.ClassFormatError"); - output.shouldContain("Main method not found in class " + className); output.shouldHaveExitValue(1); + boolean vthreadMode = pb.command().toString().contains("test.thread.factory=Virtual"); + if (vthreadMode) { + output.shouldContain("java.lang.NoSuchMethodException: " + className + ".main"); + } else { + output.shouldContain("Main method not found in class " + className); + } // Test case #2: // Try loading class with empty bootstrap_methods table where an @@ -69,7 +74,12 @@ public class TestEmptyBootstrapMethodsAttr { "-Duser.language=en", "-Duser.country=US", className); output = new OutputAnalyzer(pb.start()); output.shouldNotContain("java.lang.ClassFormatError"); - output.shouldContain("Main method not found in class " + className); output.shouldHaveExitValue(1); + vthreadMode = pb.command().toString().contains("test.thread.factory=Virtual"); + if (vthreadMode) { + output.shouldContain("java.lang.NoSuchMethodException: " + className + ".main"); + } else { + output.shouldContain("Main method not found in class " + className); + } } }