ci: run native EcoQoS tests on a Windows 11-era kernel

Windows Server 2022 build 20348 rejects GetProcessInformation(ProcessPowerThrottling) with ERROR_INVALID_PARAMETER (87), with both limited and full query handles. Windows 11 local tests pass. Use Server 2025 for CI/release tests and smoke testing; keep the real round-trip assertions, remove temporary probes.
This commit is contained in:
PrimeBuild-pc
2026-10-16 11:37:33 +02:00
parent af856d7a39
commit ebeeaec459
3 changed files with 6 additions and 19 deletions
+2 -1
View File
@@ -12,7 +12,8 @@ permissions:
jobs:
build-test-scan:
runs-on: windows-2022
# Native EcoQoS read-back needs the Windows 11-era kernel (build 22000+).
runs-on: windows-2025
steps:
- name: Checkout
+3 -2
View File
@@ -16,7 +16,8 @@ permissions:
jobs:
build:
runs-on: windows-2022
# Match the Windows 11-era APIs exercised by the native integration tests.
runs-on: windows-2025
outputs:
version: ${{ steps.version.outputs.version }}
tag: ${{ steps.version.outputs.tag }}
@@ -285,7 +286,7 @@ jobs:
if-no-files-found: error
smoke-test:
runs-on: windows-2022
runs-on: windows-2025
needs: build
steps:
@@ -24,22 +24,7 @@ namespace ThreadPilot.Core.Tests
foreach (var mode in new[] { ThreadPilot.Models.ProcessEfficiencyMode.On, ThreadPilot.Models.ProcessEfficiencyMode.Off })
{
Assert.True((await service.SetEfficiencyModeAsync(self, mode)).Success);
var observed = await service.GetEfficiencyModeAsync(self);
if (observed == null)
{
var api = ProcessMemoryPriorityNativeApi.Instance;
using var limited = api.OpenProcess(ProcessAccessFlags.PROCESS_QUERY_LIMITED_INFORMATION, false, (uint)Environment.ProcessId);
var state = new PowerThrottlingState { Version = PowerThrottlingState.CurrentVersion };
var limitedResult = api.GetPowerThrottling(limited, ref state);
var limitedError = api.GetLastWin32Error();
using var full = api.OpenProcess((ProcessAccessFlags)0x0400, false, (uint)Environment.ProcessId);
state = new PowerThrottlingState { Version = PowerThrottlingState.CurrentVersion };
var fullResult = api.GetPowerThrottling(full, ref state);
var fullError = api.GetLastWin32Error();
Assert.Fail($"OS {Environment.OSVersion}: limited query={limitedResult}, error={limitedError}; full query={fullResult}, error={fullError}, control={state.ControlMask}, state={state.StateMask}");
}
Assert.Equal(mode, observed);
Assert.Equal(mode, await service.GetEfficiencyModeAsync(self));
}
}
finally