From 6c6843fced52021972476303dfb7486fa13ad503 Mon Sep 17 00:00:00 2001 From: cixotdev <339371196+cixotdev@users.noreply.github.com> Date: Sun, 22 Nov 2026 18:27:05 -0300 Subject: fix(runtime/test): warm up two CreateProcessW starts in queue_proxy_test handle check On Windows 11 26200, check_child_runner() previously ran one successful CreateProcessW and one failed CreateProcessW before recording handles_before. However, NtQueryObject shows that the second successful CreateProcessW still opens and caches one persistent HKCU registry key handle (\REGISTRY\USER\) in the parent process before stabilizing at +0 handles on the third and later calls. That caused `handles_after == handles_before` (e.g. 123 vs 124 under ctest) to abort queue_proxy_test before testing WARP, hardware D3D12, or Vulkan queue/fence proxies. Warm up two successful `run_self(L"--child-flood 0", 30000)` starts before recording `handles_before`, while keeping the strict `handles_after == handles_before` handle-leak assertion intact. AI-assisted with Argon (Antigravity). --- runtime/test/queue_proxy_test.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'runtime/test/queue_proxy_test.cpp') diff --git a/runtime/test/queue_proxy_test.cpp b/runtime/test/queue_proxy_test.cpp index 3d5ed98fa..142eae84e 100644 --- a/runtime/test/queue_proxy_test.cpp +++ b/runtime/test/queue_proxy_test.cpp @@ -999,12 +999,15 @@ int run_runner_child(const char* mode, unsigned long bytes) { int check_child_runner() { const char* label = "child runner"; ChildResult report; - ChildRun run = run_self(L"--child-flood 0", 30000); - EXPECT(run.end == ChildEnd::exited && run.exit_code == 0 && parse_diff_report(run.tail, report)); - EXPECT(report.ran == 1 && report.hr == 0 && report.removed == 0 && report.validation == 0); - // The first start and the first failed start make Windows load what it keeps for them (a failed CreateProcessW - // leaves 42 handles the first time on Windows 11 26200, none on every later one): both run once before the handle - // count is taken, and every case after it must leave the count as it was. + ChildRun run; + // The first two successful starts and the first failed start make Windows load and cache their persistent process + // handles (on Windows 11 26200, a second CreateProcessW caches the HKCU root key and a failed CreateProcessW keeps + // 41-42 AppCompat/PCA handles; later starts add none). Warm up both before reading handles_before. + for (int warmup = 0; warmup < 2; ++warmup) { + run = run_self(L"--child-flood 0", 30000); + EXPECT(run.end == ChildEnd::exited && run.exit_code == 0 && parse_diff_report(run.tail, report)); + EXPECT(report.ran == 1 && report.hr == 0 && report.removed == 0 && report.validation == 0); + } std::fprintf(stderr, "child runner: the next four errors are expected\n"); const std::wstring missing = self_path() + L".missing.exe"; run = run_process(missing.c_str(), L"", 5000); -- cgit v1.2.3