From 0389b989f33e32d3140d5ccc6015d3996465f274 Mon Sep 17 00:00:00 2001 From: Hamir Date: Fri, 7 Aug 2026 15:20:11 -0700 Subject: [PATCH] fix: flaky `TestPrunePromptTermination` test --- internal/test/cmd.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/test/cmd.go b/internal/test/cmd.go index 8b98d2df623b..1ac066bd356d 100644 --- a/internal/test/cmd.go +++ b/internal/test/cmd.go @@ -27,8 +27,11 @@ func TerminatePrompt(ctx context.Context, t *testing.T, cmd *cobra.Command, cli })) cli.SetOut(outStream) - r, _, err := os.Pipe() + r, w, err := os.Pipe() assert.NilError(t, err) + + // Keep the write end alive for the duration of the test. + defer w.Close() cli.SetIn(streams.NewIn(r)) notifyCtx, notifyCancel := context.WithCancel(ctx)