Repository navigation
test(guide): pay the one-time redaction engine read before the warm ui.find check - #38007
jeeshofone wants to merge 1 commit into
Conversation
First Principles Review (Opus 5.5, fork) — ⏭️ skippedRevision |
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the warm-up runs a one-time cache fill before the counter is installed, and the assertion is unchanged. [DESIGN-REVIEWED] dde697c Description read[DESCRIPTION-READ] 03d8e3995f910a742acf5306211b210cac6f5a147607d2d67ae09668ee539445 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 5.5 Review (fork) — 🔴 changes requested (blocking)Reviewed The PR's only code change calls BLOCKING — test/test_guide_ui_find.py:1164 |
Problem / Motivation
Goal:
test_a_warm_catalog_validates_ui_find_without_reading_the_indexpasses when it runs alone or first in its process, not only after another test has warmed a cache.Run alone (
pytest -n0 test/test_guide_ui_find.py -k warm_catalog_validates_ui_find) on main, the test fails every time. Its read counter catches one read ofcredential_redaction.jsonunder the test home. It went red on an unrelated PR's shard 5 when the shard happened to run it before any other redacting test.Why it matters
Any change that shuffles test order can turn this test red on an unrelated PR, as it did on #37953 (a website-only change).
Not a goal
ui.findvalidation itself.What changed (motivation → approach → change)
Symptom: one
credential_redaction.jsonread inside the test's read-capture window.Cause:
ui.findpasses its label throughclean_guide_text, which callsneeds_redaction→redact_via_context→pass_compose→redaction._credential_redaction_plan→compat.use_rule_table(). The first call touse_rule_table()in a process reads the owner's engine selector fromcredential_redaction.jsonthroughredaction_switch.read_engine(). Later calls answer from memory. So the test passed only when an earlier test in the same process had already redacted something. That is a hidden ordering dependency, not a race.The product read is already one-time per process. It is not paid on every validate, so the warm
ui.findpath has nothing to fix. The test now callsredaction_compat.use_rule_table()before it installs the counter, next towarm_catalogs(). That pays the one-time read up front, the same way the test pre-warms the catalog. A comment says why. The assertion is unchanged, so a UI index read on the warm path still fails it.Backwards compatibility
Compatible: test-only change.
Removes nothing: only adds a warm-up call in one test.
Tests
test_a_warm_catalog_validates_ui_find_without_reading_the_index: before the fix it failed alone 1/1 at base1c3d9ca6fa. After the fix it passes alone 3/3, and the whole file passes (144 passed).guide_catalog._location_ids_cacheafter the warm-up makes the test fail again, so it still guards a cold catalog.Proof: not provable -- test-only change
Manual verification
N/A — the fix is in a unit test, and I ran it alone and with the whole file.
Related Issues
Fixes #37987
Sibling sweep
Swept:
git grep -ln 'setattr(Path, "read_text"' -- 'test/test_guide*'for other guide tests that count file reads around a redacting call.Siblings: none -- the only match is this test.
Pattern harvest
Not generalizable: a single test's capture window that included a once-per-process cache fill. The fix is local warm-up, matching the test's existing
warm_catalogs()call.Checklist
Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.