Skip to content

test(const): the AppType split tests pin IANA member counts, so a vendor update turns them red #1820

Closed

Description

@JarryShaw

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.

Activity

  1. added
    testPull requests that add or correct tests (test: subject prefix)
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 16, 2026
  2. JarryShaw commented on Oct 16, 2026

    @JarryShaw
    OwnerAuthor

    A worker is on this (test-only fix).

  3. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 16, 2026
  4. JarryShaw commented on Oct 16, 2026

    @JarryShaw
    OwnerAuthor

    Fixed in 1760db1b9, which went straight to main as 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 both b0256f891 and the pre-4930 data. It also put back each guarded defect, one at a time, and confirmed the matching test fails: composite proto, a wrong-transport row, a stray extra member, and a branch the regex cannot see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testPull requests that add or correct tests (test: subject prefix)

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions