diff --git a/src/borg/testsuite/archiver/debug_cmds.py b/src/borg/testsuite/archiver/debug_cmds.py index 4518a3ccf..0dd4ea139 100644 --- a/src/borg/testsuite/archiver/debug_cmds.py +++ b/src/borg/testsuite/archiver/debug_cmds.py @@ -168,7 +168,12 @@ def test_debug_refcount_obj(archivers, request): create_json = json.loads(cmd(archiver, "create", "--json", "test", "input")) archive_id = create_json["archive"]["id"] output = cmd(archiver, "debug", "refcount-obj", archive_id).strip() - assert output == f"object {archive_id} has 1 referrers [info from chunks cache]." + # LocalCache does precise refcounting, so we'll get 1 reference for the archive. + # AdHocCache or NewCache doesn't, we'll get ChunkIndex.MAX_VALUE as refcount. + assert ( + output == f"object {archive_id} has 1 referrers [info from chunks cache]." + or output == f"object {archive_id} has 4294966271 referrers [info from chunks cache]." + ) # Invalid IDs do not abort or return an error output = cmd(archiver, "debug", "refcount-obj", "124", "xyza").strip()