def METHOD_NAME(cache_dir, data, caplog):
    """
    Test when the data in the cache raises a UnicodeDecodeError
    we do not raise an error.
    """
    path = cache_dir / "minion"
    path.touch()
    cache_data = {
        "CacheDisk_data": {
            b"poc-minion": {
                None: {
                    b"secrets": {
                        b"itsasecret": data,
                        b"CacheDisk_cachetime": {b"poc-minion": 1649339137.1236317},
                    }
                }
            }
        }
    }
    with patch.object(
        salt.utils.msgpack, "load", return_value=cache_data
    ), caplog.at_level(logging.DEBUG):
        cd = cache.CacheDisk(0.3, str(path))
        # this test used to rely on msgpack throwing errors if attempt to read an empty file
        # code now checks if file empty and returns, so we should never attempt msgpack load
        assert cd._dict == {}
        assert not (
            f"Error reading cache file at '{path}': Unpack failed: incomplete input"
            in caplog.messages
        )