code: def test_state_overflow(tmp_dir, dvc):
      # NOTE: trying to add more entries than state can handle,
      # to see if it will clean up and vacuum successfully
      dvc.config["state"]["row_limit"] = 10
  
      path = tmp_dir / "dir"
      path.mkdir()
      for i in range(20):
          (path / str(i)).write_text(str(i))
  
      dvc.add("dir")
  
file_path: dvc/tests/func/test_state.py
imports: import os
  from dvc_data.hashfile.hash import file_md5
  from dvc_data.hashfile.hash_info import HashInfo
  from dvc_data.hashfile.state import State
label_desc: Use image node_id 2 for calling a global function with example usage: test_state_overflow(tmp_dir, dvc) without return types