Skip to content

CI: fix the checks that fail under parallel workers - #29

Merged
digibrander merged 2 commits into
developfrom
ci/cpu-time-tests
Nov 5, 2026
Merged

digibrander merged 2 commits into
developfrom
ci/cpu-time-tests

Conversation

@jadhavgaurav

@jadhavgaurav jadhavgaurav commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Why

PR #28 runs the backend suite on 4 workers. The first runs failed checks that measure the runner, not the code:

Failure Cause Fix
3 alias matcher timing tests (1.4 s vs 1 s, 2.8 s vs 2 s, 7.2 s vs 5 s) wall time on CPUs shared with other workers measure time.process_time(); same limits
test_a_list_holds_nothing_of_another_workspace for /me and /costs ("shows 232") the other tenant's numeric serp_snapshot_id was searched as a substring; on a fresh per-worker DB it is 3 digits and occurs inside the tenant's own UUIDs, times and decimals a numeric id counts only as a whole number (JSON number, or a digit run not inside a longer number, word or decimal); UUIDs, slugs and emails keep the substring check
5,000-keyword import acceptance: metrics not within 170 s CPU contention 290 s, inside the roadmap's 5 minute criterion (docs/29 section 3)
web job cancelled at 20 min unit tests took 11 to 19 min today job limit 30 min
huge-address sign-in test (1 s wall limit, not failed yet) same contention risk 5 s; the regression it guards takes about a minute

Proof

  • Alias tests under 42 busy loops: wall 0.24 / 0.60 / 1.55 s, CPU 0.09 / 0.21 / 0.61 s.
  • New self-check test_a_numeric_id_counts_as_shown_only_as_a_whole_value: 232 inside a UUID, a timestamp, 0.232000 and 2320 is not a leak; 232 as a number, a string, a key, a path or query segment, kw-232, id:232, snap_232, (232) and a sentence is.
  • tests/security/test_cross_tenant.py on 4 workers: 269 passed. With the import acceptance test: 270 passed.
  • ruff, format, mypy, lint-imports, actionlint pass. Two independent reviews approved; the second one's tightening (digit-boundary match instead of splitting on separators) is applied.

The check that matters is this PR's own backend and web runs.

The backend suite runs on 4 workers that share the runner's CPUs. Three alias
matcher tests measured wall time and failed on CI (1.4 s, 2.8 s, 7.2 s against
limits of 1, 2 and 5 s) while the matcher itself took 0.1 to 0.6 s. They now
measure the process's CPU time, which waiting for a core does not inflate; an
exponential or quadratic regression still costs far more than the limits.

The huge-address sign-in test goes through the API, so it keeps wall time with a
5 s limit instead of 1 s: the regression it guards against takes about a minute.
@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
idraft-preview Ready Ready Preview Nov 5, 2026 11:16am UTC
1 Skipped Deployment
Project Deployment Actions Updated
idraft-site Ignored Ignored Preview Nov 5, 2026 11:16am UTC

Request Review

…e does

The first main run on 4 workers failed three more checks, none of them a defect in
the product:

- The cross-tenant list test looked for the other tenant's numeric snapshot id as a
  substring. On a fresh per-worker database that id is three digits, so "232" was
  found inside the tenant's own UUIDs, times and decimals. A numeric id now counts
  only as a whole number (a JSON number, or a digit run not part of a longer number,
  word or decimal); ids, slugs and addresses keep the substring check. A self-check
  pins both sides.
- The 5,000-keyword import waited 170 s for metrics; the roadmap's limit is 5
  minutes, so it waits 290 s.
- The web job's unit tests took 11 to 19 minutes today and a 20 minute limit cut
  one run off; the limit is 30.
@jadhavgaurav jadhavgaurav changed the title Tests: time the alias matcher by CPU, so parallel workers cannot fail it CI: fix the checks that fail under parallel workers Nov 5, 2026
@digibrander
digibrander merged commit bbce209 into develop Nov 5, 2026
4 of 6 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