Skip to content

Commit 116fb7d

Browse files
stephentoubCopilot
andcommitted
Avoid shell kill cwd cleanup flake
Run the long-lived shell kill command outside the fixture workspace so a surviving Windows child process cannot hold copilot-test-work-* open during cleanup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3c622b9 commit 116fb7d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

dotnet/test/E2E/RpcShellAndFleetE2ETests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ public async Task Should_Kill_Shell_Process()
3434
? "powershell -NoLogo -NoProfile -Command \"Start-Sleep -Seconds 30\""
3535
: "sleep 30";
3636

37-
var execResult = await session.Rpc.Shell.ExecAsync(command);
37+
// On Windows, terminating the shell wrapper can briefly leave grandchildren alive.
38+
// Keep this command outside the fixture workspace so that cleanup is not blocked by cwd handles.
39+
var execResult = await session.Rpc.Shell.ExecAsync(command, cwd: Path.GetTempPath());
3840
Assert.False(string.IsNullOrWhiteSpace(execResult.ProcessId));
3941

4042
var killResult = await session.Rpc.Shell.KillAsync(execResult.ProcessId);

0 commit comments

Comments
 (0)