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)