From 4b7dfbd609bda54319af40c2a5a5c4db6b7b68bf Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sun, 6 Sep 2026 03:13:17 -0700 Subject: [PATCH] diagnostic: identify surviving Git Bash fixture processes --- .github/workflows/windows-terminal-restart-e2e.yml | 1 + tests/e2e/global-teardown.ts | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-terminal-restart-e2e.yml b/.github/workflows/windows-terminal-restart-e2e.yml index 22b3c48dd71..53e4835f217 100644 --- a/.github/workflows/windows-terminal-restart-e2e.yml +++ b/.github/workflows/windows-terminal-restart-e2e.yml @@ -66,6 +66,7 @@ jobs: run: >- pnpm run test:e2e tests/e2e/golden-tab-bar-agent-launch.spec.ts + --grep "under git-bash" --repeat-each=3 --workers=1 diff --git a/tests/e2e/global-teardown.ts b/tests/e2e/global-teardown.ts index 3c8c6415942..65927f4c097 100644 --- a/tests/e2e/global-teardown.ts +++ b/tests/e2e/global-teardown.ts @@ -8,6 +8,7 @@ import { execFileSync } from 'node:child_process' import { readFileSync, existsSync, realpathSync, rmSync } from 'node:fs' import { TEST_REPO_PATH_FILE } from './global-setup' +import { readWindowsProcessTableFresh } from '../../src/main/windows/windows-process-table' export function linkedWorktreePaths(testRepoDir: string): string[] { const root = realpathSync.native(testRepoDir) @@ -61,14 +62,23 @@ export function cleanupTestRepository(testRepoDir: string): void { } } -export default function globalTeardown(): void { +export default async function globalTeardown(): Promise { if (!existsSync(TEST_REPO_PATH_FILE)) { return } const testRepoDir = readFileSync(TEST_REPO_PATH_FILE, 'utf-8').trim() if (testRepoDir && existsSync(testRepoDir)) { - cleanupTestRepository(testRepoDir) + try { + cleanupTestRepository(testRepoDir) + } catch (error) { + const rows = await readWindowsProcessTableFresh() + const selected = rows.filter((row) => /^(?:sh|bash|node)\.exe$/i.test(row.name)) + const parents = new Set(selected.map((row) => row.ppid)) + console.error('TEARDOWN_PROCESS_ROWS', JSON.stringify(rows.filter((row) => + selected.includes(row) || parents.has(row.pid)))) + throw error + } console.error(`[e2e] Cleaned up test repo at ${testRepoDir}`) }