code: def test_cli(tmp_dir, dvc, mocker, caplog):
      # patching to speedup tests
      mocker.patch("dvc.lock.DEFAULT_TIMEOUT", 0.01)
  
      expected_error_msg = (
          "Unable to acquire lock. Most likely another DVC process is "
          "running or was terminated abruptly. Check the page "
          "<https://dvc.org/doc/user-guide/troubleshooting#lock-issue> "
          "for other possible reasons and to learn how to resolve this."
      )
      with Lock(tmp_dir / dvc.tmp_dir / "lock"):
          assert main(["add", "foo"]) == 1
      assert expected_error_msg in caplog.text
  
file_path: dvc/tests/func/test_lock.py
imports: import pytest
  from dvc.cli import main
  from dvc.exceptions import DvcException
  from dvc.lock import Lock, LockError
label_desc: Use image node_id 4 for calling a global function with example usage: test_cli(tmp_dir, dvc, mocker, caplog) without return types