def METHOD_NAME(fs: fsspec.AbstractFileSystem, monkeypatch, file_name: str):
    monkeypatch.setattr(TransactionalFile, "LOCK_TTL_SECONDS", 1)
    writer_1 = TransactionalFile(file_name, fs)
    writer_2 = TransactionalFile(file_name, fs)
    writer_1.acquire_lock()
    thread = Thread(target=functools.partial(writer_2.acquire_lock, timeout=5), daemon=True)
    try:
        thread.start()
        time.sleep(2.5)
        # Ensure another process cannot acquire the lock or write as long as
        # the first process is maintaining the lock and heartbeat
        with pytest.raises(RuntimeError):
            writer_2.write(b"test 2")
    finally:
        # wait for timeout that kills thread
        thread.join()