Repository navigation
Stop TestProbeGating asserting a tier the mapping check is meant to upgrade - #9029
Conversation
…pgrade
Two tests in TestProbeGating fail standalone on main:
assert get_transformers_tier("org/new") == "default"
AssertionError: assert '530' == 'default'
Which PR introduced it, and which side is wrong:
#6550 (2026-06-22) added these two tests, pinning model_type "brandnew"
#7043 (2026-07-11) added the CONFIG_MAPPING_NAMES tier, three weeks later
#7043 is right, and is not reverted here. Routing by the real mapping beats the
hardcoded tables it replaced, and raising a model_type the ambient default does
not ship is the point of it. What #7043 missed is that it now answers BEFORE the
version-field probe, so the two tests written against that probe stopped reaching
it. "brandnew" is in no mapping, so the mapping check returns 530 and the probe
never runs. They were correct when written and became wrong under a later,
correct source change.
They kept passing because _config_mapping_cache is module-global and other tests
populate it, so in the suite's serial order the mapping check found a state that
skipped the upgrade. Alone, or on an xdist worker, it does not.
Fixed by pinning a model_type the ambient default does ship, which is the only
input domain where the probe is still reachable, so the assertions measure the
probe again rather than the branch above it.
setup_method also now clears _config_mapping_cache: it cleared five caches and
missed the sixth. That is not the fix; with it and the old model_type the class
goes from two failures to three, because a third test leaned on the same stale
mapping.
Robustification, and the real gap: NOTHING pinned the ordering #7043 introduced.
Had it been pinned, #7043 would have had to update these two tests instead of
silently changing what they measured. A new test asserts that a model_type the
default lacks is answered by the mapping and never reaches the probe. Both halves
were mutation-checked:
mapping short-circuit disabled -> "a model_type the default lacks must be raised"
probe moved above the mapping -> "the mapping check must answer before any
sidecar probe runs"
before (standalone): 2 failed, 5 passed
after (standalone): 8 passed
Whole file: 5 failed -> 3 failed, the remaining 3 a pre-existing
TestDamagedLatestSidecarRepairHandoff group unrelated to this.
18e5e9f to
bd51a7d
Compare
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
CI triage for this PR: the one real failure is not from this change.
Everything else reported as failing is |
Two tests in
TestProbeGatingfail standalone onmain:They are not wrong about the probe. They are wrong about the
model_type.What actually happens
get_transformers_tierconsultsCONFIG_MAPPING_NAMESper tier and upgrades amodel_typethe ambient default does not ship. That is deliberate, and it says so:Both tests pinned
model_type: "brandnew", which no mapping ships. Driving it directly:So the static mapping tier upgraded to 530 before the version-field probe under test ever ran. The assertions were measuring the wrong thing, and they were green only when an earlier test had left
_config_mapping_cachepopulated in a way that skipped that path. That is why they pass in the suite's serial order and fail on their own.Source is correct here; the tests are. Nothing about the upgrade behaviour changes.
Fix
Use a
model_typethe ambient default does ship, so the probe rather than the mapping upgrade is what the assertions measure.setup_methodalso now clears_config_mapping_cache. It clears five caches and missed the sixth, which is exactly what let an unrelated test decide this one's answer.I checked which half does the work rather than assuming:
The clear is not the fix, and on its own it makes things worse: a third test was leaning on the same stale mapping. It is kept because with the corrected
model_typeall seven pass and the class stops depending on what ran before it.Whole file: 5 failed -> 3 failed. The remaining three are a pre-existing
TestDamagedLatestSidecarRepairHandoffgroup, unrelated to this change and failing identically on unmodifiedmain.Which PR, and which side is wrong
CONFIG_MAPPING_NAMEStier#7043 is right and is not reverted. Routing by the real mapping beats the hardcoded tables it replaced, and raising a
model_typethe ambient default does not ship is the point of it. What #7043 missed is that it now answers before the version-field probe, so the two tests written against that probe stopped reaching it. They were correct when written and became wrong under a later, correct source change.Robustification, and the real gap
Nothing pinned the ordering #7043 introduced. Had it been pinned, #7043 would have had to update these two tests instead of silently changing what they measure.
A new test asserts that a
model_typethe default lacks is answered by the mapping and never reaches the probe. Both halves were mutation-checked:a model_type the default lacks must be raised, got 'default'the mapping check must answer before any sidecar probe runsStandalone: 2 failed, 5 passed -> 8 passed.
One consequence worth stating: after #7043 the version-field probe is only reachable for a
model_typethe default mapping does ship, because a brand-new one is caught by the branch above it. Sollamais not a weakening of the original scenario, it is the only input domain where the code under test is still live.Found while measuring whether the backend suite can run under
pytest-xdist: these two fail on a runner under-n 4and pass serially, for exactly this reason.