Skip to content

🧪 test: replace wall-clock checks with a bench - #975

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/flaky-timing-tests
Oct 2, 2026
Merged

gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/flaky-timing-tests

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

Two checks added with #955 and #966 compared wall-clock time to show that duplicate-attribute detection and the IDNA input cap stay linear. On a loaded runner the ratio crossed its threshold on unmodified main, so test_xml_duplicate_detection_scales_linearly failed 3.14t on macOS in #972 for a change that touches no XML code.

The IDNA check now asserts what the cap guarantees without a clock: past 16384 code points normalize_url returns the host in its Unicode form. The XML check moves to the CodSpeed gate, which counts instructions and does not drift with load. ⚡ parse-xml-prefixes gains a 1,000-prefix case, gated as parse-xml-prefixes-wide; under callgrind, reverting #955 raises its instruction count by 57%, and the existing parse-xml-attrs and parse-xml-prefixes cases by 12% and 36%.

closes #969

The XML duplicate-attribute and IDNA input-cap checks compared wall-clock
time, so a loaded runner turned unrelated jobs red at random. The IDNA
check now asserts the deterministic result past the cap, and a 1,000-prefix
parse-xml-prefixes case gated in CodSpeed guards the quadratic duplicate
check instead: reverting tox-dev#955 raises its instruction count by 57%.

closes tox-dev#969
@gaborbernat gaborbernat added the bug Something isn't working label Oct 2, 2026
@gaborbernat
gaborbernat merged commit c795023 into tox-dev:main Oct 2, 2026
16 of 50 checks passed
@gaborbernat
gaborbernat deleted the fix/flaky-timing-tests branch October 2, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XML duplicate-attribute scaling test depends on timing

1 participant