Description
tests/const/test_const_apptype_split_unit.py hardcodes IANA's per-registry member counts: {'TCP': 6147, 'UDP': 6143, 'SCTP': 91, 'DCCP': 10}, plus a 12,391 total and a 766 that is also count-derived (lines 868, 981-992, 1264, 1295, 1338, 1370). The values come from upstream data, not from the code under test, so any vendor update that adds or removes a port breaks the test even when the code is correct.
That has now happened. b0256f891 (the 1.5.0b13 bump) added port 4930 (TCP.fmsg, UDP.reserved_4930). On that commit, 5 tests in the file fail with 6148 != 6147 : TCP population changed, 12393 != 12391 and 767 != 766. I reproduced this locally on origin/main. Main's Unit Tests run 38874587976 for that commit is still in progress, so expect it to go red.
Fix: make the expectations count-free by deriving them from the registries themselves. Keep each test's original defect detection: #806 (composite proto), #807 (aliases), and the extra-member regression that the hardcoded len(TCP) caught. A mutation run must still fail. The docstrings repeat the same counts, and those go too.
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
Activity
JarryShaw commentedon Oct 16, 2026
A worker is on this (test-only fix).
JarryShaw commentedon Oct 16, 2026
Fixed in
1760db1b9, which went straight tomainas a test-only change. The tests no longer pin populations: they compare each live registry against the members its generated module declares. A Sonnet cross-review (the author was Opus) found them GOOD TO GO. It checked that they pass on bothb0256f891and the pre-4930 data. It also put back each guarded defect, one at a time, and confirmed the matching test fails: compositeproto, a wrong-transport row, a stray extra member, and a branch the regex cannot see.