RFR: 8292362: java/lang/Thread/jni/AttachCurrentThread/AttachTest.java#id1 failed on some platforms [v2]

Ao Qi aoqi at openjdk.org
Mon Aug 15 13:59:16 UTC 2022


On Mon, 15 Aug 2022 13:30:15 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> > Shouldn't we throw a SkippedException in this case?
> 
> It's the child VM that skips so throwing SkippedException would require special handling in the parent.

Like this?

diff --git a/test/jdk/java/lang/Thread/jni/AttachCurrentThread/AttachTest.java b/test/jdk/java/lang/Thread/jni/AttachCurrentThread/AttachTest.java
index b93e7918014..156bbe35c62 100644
--- a/test/jdk/java/lang/Thread/jni/AttachCurrentThread/AttachTest.java
+++ b/test/jdk/java/lang/Thread/jni/AttachCurrentThread/AttachTest.java
@@ -48,6 +48,8 @@ import java.util.stream.Stream;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
 
+import jtreg.SkippedException;
+
 public class AttachTest {
     static final String TEST_CLASSES = System.getProperty("test.classes");
     static final String JAVA_LIBRARY_PATH = System.getProperty("java.library.path");
@@ -63,6 +65,9 @@ public class AttachTest {
                 .executeTestJava(opts)
                 .outputTo(System.out)
                 .errorTo(System.out);
+        if (outputAnalyzer.getOutput().contains("Test skipped, no native linker on this platform")) {
+            throw new SkippedException("Test skipped, no native linker on this platform");
+        }
         outputAnalyzer.shouldHaveExitValue(0);
     }
 }

Do I need to add this change?

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

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


More information about the core-libs-dev mailing list