Skip to content

Faster PHPUnit setUp (fixes CircleCI build timeouts) - #915

Merged
ngm merged 1 commit into
developfrom
faster-phpunit-setup
Sep 23, 2026
Merged

ngm merged 1 commit into
developfrom
faster-phpunit-setup

Conversation

@edwh

@edwh edwh commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Speeds up TestCase::setUp, which runs before every test under processIsolation.

  • Tables are cleared with DELETE instead of TRUNCATE.
  • Auto increments are only re-randomised (to 101–200) while still ≤100, i.e. after migrate:fresh, rather than via ALTER TABLE on every table per test.
  • The networks counter is reset every test (1–100), because network ids are stored in the tinyint users.repair_network.

PHPUnit on CI: ~23 min (was ~45). Build job: ~37 min, within CircleCI's 60 min limit.

🤖 Generated with Claude Code

…test

TestCase::setUp ran 20 TRUNCATEs and an ALTER TABLE AUTO_INCREMENT on all
68 tables before every test (~5s each under processIsolation), which put
PHPUnit at ~45 of the build job's 60 minutes and caused timeouts. Now uses
DELETE, only re-randomises auto increments that are still low (just after
migrate:fresh), and always resets networks (its ids go in the tinyint
users.repair_network). ~4x faster locally.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@ngm
ngm merged commit a76e5a9 into develop Sep 23, 2026
3 checks passed
@edwh
edwh deleted the faster-phpunit-setup branch October 1, 2026 20:16
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