Skip to content

fix: raise memory_limit in composer test scripts#107

Merged
markshust merged 1 commit into
developfrom
feature/composer-test-memory-limit
Jun 3, 2026
Merged

fix: raise memory_limit in composer test scripts#107
markshust merged 1 commit into
developfrom
feature/composer-test-memory-limit

Conversation

@markshust
Copy link
Copy Markdown
Collaborator

Summary

  • composer test and composer test:all were dying with Allowed memory size of 134217728 bytes exhausted on default PHP installs (CLI memory_limit=128M) before any test could run — Pest's parallel discovery across 90+ Marko packages exceeds that limit during paratest's SuiteLoader phase.
  • Wrap both scripts with php -d memory_limit=2G vendor/bin/pest … so they work out of the box without requiring users to bump their global php.ini.

Test plan

  • composer test runs to completion: 6138 passed, 36 risky, 145 notices, 22 skipped (18913 assertions, ~5s parallel).
  • Confirm CI still picks up the same invocation path (CI typically sets its own memory_limit, so this is a no-op there but a quality-of-life win locally).

🤖 Generated with Claude Code

The default PHP CLI memory_limit (128M) is insufficient for Pest's
parallel test discovery across all 90+ Marko packages, causing
`composer test` to die with "Allowed memory size of 134217728 bytes
exhausted" before any test runs. Wrap the test/test:all scripts with
`php -d memory_limit=2G` so they work out of the box on default PHP
installs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the bug Something isn't working label Jun 3, 2026
@markshust markshust merged commit 7b03a21 into develop Jun 3, 2026
1 check passed
@markshust markshust deleted the feature/composer-test-memory-limit branch June 3, 2026 14:20
michalbiarda pushed a commit to michalbiarda/marko that referenced this pull request Jun 4, 2026
bin/release.sh runs pest directly (not via `composer test`) to include
the integration-destructive group, so it didn't pick up the
memory_limit bump from marko-php#107. Default PHP CLI memory_limit (128M) is
exhausted during paratest's parallel suite loader, aborting the
release before any test runs. Mirror the composer-script fix by
passing `-d memory_limit=2G` to the pest invocation here as well.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
michalbiarda pushed a commit to michalbiarda/marko that referenced this pull request Jun 4, 2026
IntegrationVerificationTest spawns pest as a subprocess (via exec) to
verify the suite still runs after a destructive composer reinstall and
to assert no fatal PHP errors surface in the output. Those subprocesses
inherit the default CLI memory_limit (128M), so paratest's parallel
suite loader exhausts memory mid-run — which the assertion at
tests/IntegrationVerificationTest.php:171 then catches as a "PHP Fatal
error" in the captured output, failing the release.

Pass `-d memory_limit=2G` to both pest invocations (lines 109 and 162),
mirroring the fix in marko-php#107 / marko-php#108.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant