Skip to content

fix(protocols): three TLS extension rejections are loud on PyPy, failing the required pypy3.11 leg #2637

Closed

Description

@JarryShaw

The required Python pypy3.11 leg has failed on every Unit Tests run since #2595 merged (0ef7139a6). The runs include #2617, #2614 G2, #2483, #2561, the #2614 padding commit and #2616. Each fails the same three subtests of tests/protocols/application/test_tls_extension_quiet_rejection_2514_unit.py::QuietRejectionTests::test_a_shipped_decoders_rejection_is_quiet: alpn list length mismatch, supported_groups odd length and supported_versions odd length. The failure is:

AssertionError: <function set_trim_rule.<locals>.tbtrim_excepthook ...> is not <function QuietRejectionTests.setUp.<locals>._sys_sentinel ...>

The rejection should be quiet under #2588's rule. On PyPy it instead installs the traceback-trimming excepthook, so these three handled refusals are loud there. The other cases in the same test pass, and so does CPython. The fix is to find what differs on PyPy for these three decode paths (each raises through a list or vector length check) and fix it at the source.

Activity

  1. added this to the PyPCAPKit v1.6 milestone on Nov 2, 2026
  2. added
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Nov 2, 2026
  3. JarryShaw commented on Nov 2, 2026

    @JarryShaw
    OwnerAuthor

    Landed on main as 18544c3c9 (test-only). The failure was in the tests, not PyPy, and the decoders were never loud.

    Cause: QuietRejectionTests.setUp installs its hook sentinels before pcapkit is re-imported. That re-import calls tbtrim.set_trim_rule, which replaces both hooks. The test therefore fails whenever it runs first in its class on a worker. PyPy's xdist sharding happened to place it there, and the same isolated run reproduces it on CPython.

    Fix:

    • The two affected test classes import pcapkit before saving their sentinels. One is in this module; the other is a latent case in test_dtls_connection_id_2515_unit.
    • A new project guard fails on any test that sets an excepthook after a purge and before importing pcapkit.

    Docstrings: BaseError and _install_excepthook say importing pcapkit never touches the hooks, but pcapkit/__init__.py does install tbtrim's hook at import, outside dev mode. That question is filed separately.

  4. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Nov 2, 2026
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

    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions