Skip to content

Commit 9426dd9

Browse files
author
duke
committed
Backport 34c4d895ca321508c24b13338900d617679aadae
1 parent 7ce55b9 commit 9426dd9

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

test/hotspot/jtreg/runtime/os/windows/TestAvailableProcessors.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -31,18 +31,14 @@
3131
* @requires vm.flagless
3232
* @library /test/lib
3333
* @compile GetAvailableProcessors.java
34-
* @run testng TestAvailableProcessors
34+
* @run testng/othervm/native TestAvailableProcessors
3535
*/
3636

3737
import java.io.IOException;
38-
import java.nio.file.Path;
39-
import java.nio.file.Paths;
40-
import java.util.ArrayList;
4138
import java.util.List;
4239
import java.util.HashSet;
4340
import java.util.Set;
4441

45-
import jdk.test.lib.Utils;
4642
import jdk.test.lib.process.OutputAnalyzer;
4743
import jdk.test.lib.process.ProcessTools;
4844

@@ -172,12 +168,8 @@ private static void verifyAvailableProcessorsWithEnabledProductFlag(boolean sche
172168

173169
@Test
174170
private static void testProcessorAvailability() throws IOException {
175-
// Launch GetProcessorInfo.exe to gather processor counts
176-
Path nativeGetProcessorInfo = Paths.get(Utils.TEST_NATIVE_PATH)
177-
.resolve("GetProcessorInfo.exe")
178-
.toAbsolutePath();
179-
180-
var processBuilder = new ProcessBuilder(nativeGetProcessorInfo.toString());
171+
// Launch "<nativepath>/GetProcessorInfo.exe" to gather processor counts
172+
var processBuilder = new ProcessBuilder("GetProcessorInfo.exe");
181173
var outputAnalyzer= new OutputAnalyzer(processBuilder.start());
182174
outputAnalyzer.shouldHaveExitValue(0);
183175
outputAnalyzer.shouldContain(totalProcessorCountMessage);

0 commit comments

Comments
 (0)