8000 perf(ci): make the test suites fit the self-hosted runner by adeelahmad · Pull Request #145 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

perf(ci): make the test suites fit the self-hosted runner - #145

Merged
adeelahmad merged 3 commits into
mainfrom
claude/project-thread-xctuid
Oct 4, 2026
Merged

adeelahmad merged 3 commits into
mainfrom
claude/project-thread-xctuid

Conversation

@adeelahmad
@adeelahmad adeelahmad commented Oct 4, 2026 •
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Before: no CI run on main had finished since 10:15. The backend suite against a SurrealDB server timed out on the "Apps" runner (only 56% done after 75 min), the embedded suite took 28 of its 30 min, and two frontend tests failed only on the runner because it is slow (Jest's 20 s test limit, testing-library's 1 s waitFor).

After: the backend suites do much less work per test, and the slow-runner frontend failures are fixed. Locally the embedded suite went from 204 s to 120 s and the server suite runs in 180 s. No test is skipped or removed.

How:

  • Each test's database got its 272 schema statements one round trip at a time; it now gets them in one (DB.run(..., transaction=False)).
  • A server connection pool signed in all 8 connections up front; it opens one and grows as concurrent queries need more.
  • CI's SurrealDB container keeps its surrealkv data on a tmpfs. Syncing every write to the runner's disk made one schema take 0.7 s instead of 0.16 s.
  • Tests hash passwords with scrypt N=2^10 instead of production's 2^15 (32 MB each). Stored hashes carry their own N, so production behaviour is unchanged.
  • Backend test steps have 60/75 min and print their 20 slowest tests; the collections dialog test is split into one test per flow; jest.setup.ts gives waitFor/findBy 10 s.

Separately, 96 queued runs for already merged PRs were cancelled so main's run isn't stuck behind them.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GSZ2xxfNPjTPbhi8YqoPGm

… the slow collections test

The embedded suite took 28 min of its 30 on the runner at 544 tests, and
the server suite timed out at 30 with a third left; both now report their
slowest tests. The collections dialog test ran five flows in one test and
took 36 s against Jest's 20 s; each flow is its own test now.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GSZ2xxfNPjTPbhi8YqoPGm
@adeelahmad adeelahmad self-assigned this Oct 4, 2026
adeelahmad pushed a commit that referenced this pull request Oct 4, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DdhQ2PsqzCyrKNDV1SJZAA
claude added 2 commits October 4, 2026 18:12
The setup wizard test's waitFor gave up after testing-library's default
1 s on the runner while the dialog was still rendering.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GSZ2xxfNPjTPbhi8YqoPGm
…runner

- Every test's database got its schema one statement at a time, 272 round
  trips; it is one now.
- A server connection pool opened all 8 connections (8 sign-ins) up front;
  it opens one and grows as concurrent queries need more.
- CI's SurrealDB server keeps its surrealkv data on a tmpfs: syncing each
  write to the runner's disk made one schema take 0.7 s instead of 0.16 s.
- Tests hash passwords with scrypt N=2^10 instead of production's 2^15
  (32 MB each); stored hashes carry their own N, so production is unchanged.

Locally the embedded suite went from 204 s to 120 s; against a server it is
180 s. No test skipped.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GSZ2xxfNPjTPbhi8YqoPGm
@adeelahmad adeelahmad changed the title ci: give the backend suites room on the self-hosted runner, and split the slow collections test perf(ci): make the test suites fit the self-hosted runner Oct 4, 2026
@adeelahmad
adeelahmad merged commit 9f97563 into main Oct 4, 2026
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

0