From 9426dd9dbd5f69c8bfb8895bcaf5077b9829895c Mon Sep 17 00:00:00 2001 From: duke Date: Thu, 24 Apr 2025 13:04:05 +0000 Subject: [PATCH] Backport 34c4d895ca321508c24b13338900d617679aadae --- .../os/windows/TestAvailableProcessors.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/test/hotspot/jtreg/runtime/os/windows/TestAvailableProcessors.java b/test/hotspot/jtreg/runtime/os/windows/TestAvailableProcessors.java index f7dc237d07d..795b3d76e54 100644 --- a/test/hotspot/jtreg/runtime/os/windows/TestAvailableProcessors.java +++ b/test/hotspot/jtreg/runtime/os/windows/TestAvailableProcessors.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 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 @@ -31,18 +31,14 @@ * @requires vm.flagless * @library /test/lib * @compile GetAvailableProcessors.java - * @run testng TestAvailableProcessors + * @run testng/othervm/native TestAvailableProcessors */ import java.io.IOException; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; import java.util.List; import java.util.HashSet; import java.util.Set; -import jdk.test.lib.Utils; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; @@ -172,12 +168,8 @@ private static void verifyAvailableProcessorsWithEnabledProductFlag(boolean sche @Test private static void testProcessorAvailability() throws IOException { - // Launch GetProcessorInfo.exe to gather processor counts - Path nativeGetProcessorInfo = Paths.get(Utils.TEST_NATIVE_PATH) - .resolve("GetProcessorInfo.exe") - .toAbsolutePath(); - - var processBuilder = new ProcessBuilder(nativeGetProcessorInfo.toString()); + // Launch "/GetProcessorInfo.exe" to gather processor counts + var processBuilder = new ProcessBuilder("GetProcessorInfo.exe"); var outputAnalyzer= new OutputAnalyzer(processBuilder.start()); outputAnalyzer.shouldHaveExitValue(0); outputAnalyzer.shouldContain(totalProcessorCountMessage);