Skip to content

Commit

Permalink
fix test_debug_refcount_obj for misc. refcounts
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasWaldmann committed Apr 4, 2024
1 parent 8f2d41a commit 1389bd1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/borg/testsuite/archiver/debug_cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 1389bd1

Please sign in to comment.