Skip to content

flaky: ReDoS "pre-fix pattern scales quadratically" timing ratios fail on shared macOS runners #2901

Closed

Description

@squid-protocol

Seen on PR #2900 (run 34288012477, full-suite-matrix (macos-latest, 3.10)) and earlier on run 34212533327, unrelated to either PR's diff:

FAILED tests/extraction/languages/test_embedded_python_strict.py::test_embedded_python_spec_exposure_redos_immunity
AssertionError: expected quadratic scaling on the pre-fix pattern, got durations=[0.0032, 0.0167, 0.0762, 0.1760]

The test's second half asserts durations[-1] / durations[-2] > 2.5 for the pre-fix regex over 8000 → 16000 bytes; the runner produced 2.31. test_naming_convention_signatures.py::test_var_decl_pattern_scales_linearly_not_quadratically failed the same way on run 34281710112. Every one of these is a wall-clock ratio measured on a shared macOS runner, where a 0.08 s sample is inside scheduling noise.

The property worth pinning is that the fixed pattern is fast -- an absolute bound (or a linear-scaling ratio with a generous ceiling) on the shipped regex -- not that the historical bad pattern is slow enough. The "pre-fix is quadratic" half of each test documents the bug it fixed but cannot be made deterministic on a shared runner; suggest dropping it or marking it @pytest.mark.skipif(sys.platform == "darwin") / a slow marker, and keeping the fixed-pattern bound.

Affected (grep expected quadratic scaling / scales_linearly): tests/extraction/languages/test_embedded_python_strict.py (two asserts, thresholds 2.0 and 2.5), tests/core_engine/test_naming_convention_signatures.py.

Activity

  1. added
    bug
    testing
    on Sep 8, 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

    bugtesting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions