Skip to content

tests: 5s wall-clock time_limit flakes under xdist (test_ipv4_unit truncated option) #1058

Closed

Description

@JarryShaw

tests/protocols/internet/test_ipv4_unit.py::IPv4UnitTests::test_a_truncated_option_still_parses_its_declared_length failed on #1054's Python 3.12 leg (job 112038796404) with TimeoutError: did not finish within 5s from tests/_support.py:72. The other four Python legs passed on the same head, and #1054 touches only httpv1.

The traceback ends inside nested <frozen abc> __subclasscheck__ calls, reached from infoclass.__update__'s isinstance(dict_, collections.abc.Mapping) (infoclass.py:455). So the parse was slow, not hung. That fits ABC subclass caches growing as purge_modules re-imports pcapkit within one xdist worker; #1052's investigation found the same re-import growth on the unittest leg. The mechanism is UNVERIFIED.

time_limit(5) is wall-clock (signal.alarm) and is used 22 times under tests/, so any of them can flake on a loaded 4-core runner.

Fix: keep the hang guard, but make it robust to a slow runner. Raise the per-test deadline, or derive it from a measured baseline, and confirm whether ABC cache growth from repeated re-imports is the real cost. This overlaps with #1052's item B (run_unittest_leg re-import bounding) and item D (pytest-timeout).

Activity

  1. added this to the 1.5 milestone on Oct 6, 2026
  2. added
    testPull requests that add or correct tests (test: subject prefix)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 6, 2026
  3. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 6, 2026
  4. moved this to Done in PyPCAPKiton Oct 6, 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

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

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions