fix test_debug_refcount_obj for misc. refcounts

This commit is contained in:
Thomas Waldmann 2023-10-01 00:34:35 +02:00
parent 8f2d41ab6c
commit 1389bd10bc
No known key found for this signature in database
GPG Key ID: 243ACFA951F78E01
1 changed files with 6 additions and 1 deletions

View File

@ -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()