From 711a72f28ba3338b6f3ea432f27b01ba1af7d552 Mon Sep 17 00:00:00 2001 From: tauraamui Date: Wed, 15 Oct 2025 09:09:26 +0100 Subject: [PATCH] test(fix): address lint issue re: calling command within test --- internal/llm/tools/grep_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/llm/tools/grep_test.go b/internal/llm/tools/grep_test.go index b858218d9cd23af6b682046d5664cb88bd33c0ec..9f1e432b8bb1a20f793a02e8d241f89c029339cb 100644 --- a/internal/llm/tools/grep_test.go +++ b/internal/llm/tools/grep_test.go @@ -205,7 +205,9 @@ func TestSearchWithRipGrepButItFailsToRunHandleError(t *testing.T) { { name: "exit code 1 returns no matches and no error", err: func() error { - cmd := exec.Command("sh", "-c", "exit 1") + ctx, cancel := context.WithTimeout(t.Context(), 1*time.Second) + defer cancel() + cmd := exec.CommandContext(ctx, "sh", "-c", "exit 1") err := cmd.Run() require.Error(t, err) exitErr, ok := err.(*exec.ExitError)