Skip to content

Commit 1389bd1

Browse files
fix test_debug_refcount_obj for misc. refcounts
1 parent 8f2d41a commit 1389bd1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/borg/testsuite/archiver/debug_cmds.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,12 @@ def test_debug_refcount_obj(archivers, request):
168168
create_json = json.loads(cmd(archiver, "create", "--json", "test", "input"))
169169
archive_id = create_json["archive"]["id"]
170170
output = cmd(archiver, "debug", "refcount-obj", archive_id).strip()
171-
assert output == f"object {archive_id} has 1 referrers [info from chunks cache]."
171+
# LocalCache does precise refcounting, so we'll get 1 reference for the archive.
172+
# AdHocCache or NewCache doesn't, we'll get ChunkIndex.MAX_VALUE as refcount.
173+
assert (
174+
output == f"object {archive_id} has 1 referrers [info from chunks cache]."
175+
or output == f"object {archive_id} has 4294966271 referrers [info from chunks cache]."
176+
)
172177

173178
# Invalid IDs do not abort or return an error
174179
output = cmd(archiver, "debug", "refcount-obj", "124", "xyza").strip()

0 commit comments

Comments
 (0)