Skip to content

test: fail if the suite takes over 40s - #1263

Merged
rom1504 merged 1 commit into
PrismarineJS:masterfrom
u9g:test-speed-regression
Aug 30, 2026
Merged

test: fail if the suite takes over 40s#1263
rom1504 merged 1 commit into
PrismarineJS:masterfrom
u9g:test-speed-regression

Conversation

@u9g

@u9g u9g commented Aug 30, 2026

Copy link
Copy Markdown
Member

Problem

The suite used to take ~3min. Almost all of that was protodef-validator < 1.5.0 validating dataType in time quadratic in the number of registered types (ProtoDef-io/node-protodef-validator#18), plus Ajv's O(n²) uniqueItems (removed in #1259). It now runs in ~20s, but nothing guards against that coming back.

Change

  • Require protodef-validator@^1.5.0.
  • Root after hook asserts total suite wall-clock (performance.now(), measured from process start) stays under 40s — ~2x the current ~20s, while the old behaviour overshoots it by ~4x.

Verification

  • With 1.5.0: 1849 passing, suite in ~20s.
  • With 1.4.0 installed the suite takes ~2m40s locally and the hook fails.

@u9g
u9g force-pushed the test-speed-regression branch from a4c444b to 34927c1 Compare August 30, 2026 12:30
@u9g u9g changed the title test: fail if validating every protocol.json takes over 30s test: fail if validating every protocol.json takes over 10s Aug 30, 2026
The suite used to take ~3min, almost all of it in protodef-validator < 1.5.0
(quadratic dataType validation, PrismarineJS#1259 removed the other hotspot, Ajv's
uniqueItems). Require 1.5.0 and assert total suite wall-clock stays under 40s
(~20s locally) so a regression shows up in CI.
@u9g
u9g force-pushed the test-speed-regression branch from 34927c1 to bb74d07 Compare August 30, 2026 12:31
@u9g u9g changed the title test: fail if validating every protocol.json takes over 10s test: fail if the suite takes over 40s Aug 30, 2026
@rom1504
rom1504 merged commit 3b06f18 into PrismarineJS:master Aug 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants