From b2f5033bf6f4bd3c9fe28cb4c1947a9765cfb897 Mon Sep 17 00:00:00 2001 From: Gleb Khmyznikov Date: Thu, 4 Dec 2025 10:51:20 -0800 Subject: [PATCH] Revert "Try to debug why TestShowZonesOnShiftDuringDrag don't run" This reverts commit a0cab997e0ea01b4fd73d66dce0d658ef6d25f5e. --- src/common/UITestAutomation/SessionHelper.cs | 65 +------------------- 1 file changed, 2 insertions(+), 63 deletions(-) diff --git a/src/common/UITestAutomation/SessionHelper.cs b/src/common/UITestAutomation/SessionHelper.cs index ba0d8da484..0ca3eb3ddd 100644 --- a/src/common/UITestAutomation/SessionHelper.cs +++ b/src/common/UITestAutomation/SessionHelper.cs @@ -181,75 +181,14 @@ namespace Microsoft.PowerToys.UITest ExitExe(runnerProcessInfo.FileName); runner = Process.Start(runnerProcessInfo); - WaitForWindowAndSetCapability(opts, "PowerToys Settings", 5000, 3); + WaitForWindowAndSetCapability(opts, "PowerToys Settings", 5000, 5); // Exit CmdPal UI before launching new process if use installer for test ExitExeByName("Microsoft.CmdPal.UI"); } catch (Exception ex) { - // Visual debugging: Execute command via CMD with visible window - Debug.WriteLine($"Failed to launch PowerToys Settings. Executing visual debug..."); - - var debugCmdInfo = new ProcessStartInfo - { - FileName = "cmd.exe", - Arguments = $"/k \"{locationPath + runnerPath}\" --open-settings", - UseShellExecute = true, - CreateNoWindow = false, - WindowStyle = ProcessWindowStyle.Normal, - }; - - try - { - Process.Start(debugCmdInfo); - } - catch (Exception cmdEx) - { - Debug.WriteLine($"Failed to start debug CMD: {cmdEx.Message}"); - } - - // Show Task Manager filtered by "Power" - try - { - var taskMgrInfo = new ProcessStartInfo - { - FileName = "taskmgr.exe", - Arguments = "/0", - UseShellExecute = true, - }; - Process.Start(taskMgrInfo); - - // Give Task Manager time to open - Thread.Sleep(3000); - - // List all "Power" processes in debug output - Debug.WriteLine("\n=== PowerToys Related Processes ==="); - var powerProcesses = Process.GetProcesses() - .Where(p => p.ProcessName.Contains("Power", StringComparison.OrdinalIgnoreCase)) - .ToList(); - - foreach (var proc in powerProcesses) - { - try - { - Debug.WriteLine($"Process: {proc.ProcessName}, ID: {proc.Id}, Path: {proc.MainModule?.FileName ?? "N/A"}"); - } - catch - { - Debug.WriteLine($"Process: {proc.ProcessName}, ID: {proc.Id}, Path: [Access Denied]"); - } - } - - Debug.WriteLine("=================================\n"); - } - catch (Exception tmEx) - { - Debug.WriteLine($"Failed to show Task Manager: {tmEx.Message}"); - } - - Thread.Sleep(3000); - throw new InvalidOperationException($"Failed to launch PowerToys Settings: {ex.Message}\nRunner Path: {locationPath + runnerPath}\nCheck CMD window and Task Manager for details.", ex); + throw new InvalidOperationException($"Failed to launch PowerToys Settings: {ex.Message}", ex); } }