Skip to content
This repository was archived by the owner on Jul 15, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions test/hotspot/jtreg/runtime/os/windows/TestAvailableProcessors.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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 "<nativepath>/GetProcessorInfo.exe" to gather processor counts
var processBuilder = new ProcessBuilder("GetProcessorInfo.exe");
var outputAnalyzer= new OutputAnalyzer(processBuilder.start());
outputAnalyzer.shouldHaveExitValue(0);
outputAnalyzer.shouldContain(totalProcessorCountMessage);
Expand Down