Skip to content

Commit e5ea172

Browse files
imcodes-winclaude
andcommitted
test(windows-ci): dump every cmd.exe + CommandLine on stale-watchdog test
CI failure from previous commit (after the timeout bump): AssertionError: fake watchdog PID 8620 should be killed. Driver stdout: Driver stderr: [driver] before kill, fakePid=8620 [driver] after kill The driver's `killAllStaleWatchdogs()` ran to completion but the fake watchdog process is still alive. Either: - PowerShell's `Get-CimInstance Win32_Process | Where-Object CommandLine -like '*daemon-watchdog*'` returned nothing on the GitHub Actions runner image - or it returned PIDs but taskkill couldn't act on them To diagnose: the driver now dumps every cmd.exe process and its full CommandLine value via `Get-CimInstance Win32_Process | Format-List` BEFORE calling killAllStaleWatchdogs. The output lands in the test's assertion message so the next CI failure will show exactly what PowerShell sees on the runner image — and we can then fix the filter accordingly. Local tests still pass (3/3). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f299aa1 commit e5ea172

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/util/windows-stale-watchdog-cleanup.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,19 @@ describe('stale watchdog cleanup (Windows-only end-to-end)', () => {
113113
expect(spawned, `fake watchdog PID ${fakePid} did not appear`).toBe(true);
114114

115115
// Run killAllStaleWatchdogs() in a child process so vitest mocks don't
116-
// touch the real fs/child_process modules. Also print diagnostics so
117-
// CI failures are easy to debug.
116+
// touch the real fs/child_process modules. Also dump what PowerShell
117+
// sees so CI failures expose the actual CommandLine values.
118118
const moduleUrl = pathToFileURL(join(repoRoot, 'dist/src/util/windows-daemon.js')).href;
119119
const driverSource = `
120120
import { killAllStaleWatchdogs } from ${JSON.stringify(moduleUrl)};
121+
import { execSync } from 'child_process';
121122
console.error('[driver] before kill, fakePid=${fakePid}');
123+
// Diagnostic: show every cmd.exe and its CommandLine so we can see
124+
// why the filter may not be matching on this Windows runner.
125+
try {
126+
const all = execSync('powershell -NoProfile -NonInteractive -Command "Get-CimInstance Win32_Process -Filter \\\\"Name=\\'cmd.exe\\'\\\\" | Select-Object ProcessId, CommandLine | Format-List"', { encoding: 'utf8' });
127+
console.error('[driver] all cmd.exe processes:\\n' + all);
128+
} catch (e) { console.error('[driver] diag failed:', String(e)); }
122129
killAllStaleWatchdogs();
123130
console.error('[driver] after kill');
124131
`;

0 commit comments

Comments
 (0)