docs: test_tags_in_items_match_tag_list fails on live data — docket tag drift from P36/P37 tag operations #623
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Surfaced during #618's full-suite gate proof:
tests/docs/test_docs_build.py::TestExportLibrary::test_tags_in_items_match_tag_listfails against the live bib store (a docket tag present on items is missing from the exported tag list). Pre-existing on clean main (verified via stash), local-only (CI containers don't carrydata/bib.sqlite). Almost certainly drift from this week's controller tag operations (addedcms-rule:CMS-1832-Fto NHRGIHGD, added/removedyear:tags on 2KVJ2HKX/5ITGVDJV, newsup:2027_PFS_NPRMtag) without regenerating whatever tag-list export the docs test validates. Fix: regenerate the export (find the generator the test names) or make the test's fixture hermetic; decide which is the intended contract. Cost #618 a full 25-min suite run — worth fixing promptly.Root cause confirmed and fixed in f346007 — it was not stale-export drift but a mid-export race: the exporter hydrated all ~184k items (minutes) and only then queried
list_tags(). During #618's suite run, controller tag ops (P37year:tag removals on 2KVJ2HKX/5ITGVDJV) landed in that window — the removed tag stayed on already-serialized items but dropped out of the later tag query (zero-count tags vanish from the JOIN), poisoning the on-disklibrary.jsonsotest_tags_in_items_match_tag_listfailed on every subsequent run.Fix (two-part, contract decided):
STACK_BIB_DB/STACK_LIBRARY_JSONoverrides; test_tags_match_item_tags pins tag/item consistency exactly. Live-store validation belongs to the docs build itself — the suite no longer reads the constantly-mutatingdata/bib.sqlite, so this class of 25-minute-suite-killing flake can't recur.Verification: 9/9 docs tests green in ~3s (hermetic, runs in CI too now — previously skipped there for lack of
bib.sqlite); pre-commit hook gate green; livelibrary.jsonregenerated clean (orphans:[]).