Skip to content

Make Composer command timeout configurable - #39

Merged
omarlopesino merged 7 commits into
Metadrop:1.xfrom
AndrewGearhart:fix/composer-timeout
Nov 17, 2026
Merged

omarlopesino merged 7 commits into
Metadrop:1.xfrom
AndrewGearhart:fix/composer-timeout

Conversation

@AndrewGearhart

Copy link
Copy Markdown
Contributor

Composer commands currently stop after a hard-coded 300 seconds even when COMPOSER_PROCESS_TIMEOUT is increased. Add composerTimeout to the YAML configuration and apply it to both Symfony Process and the child Composer environment. The default remains 300 seconds, non-Composer commands retain their existing limit, and explicit shell timeouts still take effect.

Add locally runnable PHPUnit coverage for configuration, process limits, and CLI behavior. The functional tests invoke the actual CLI with controlled Composer commands in disposable Git projects; no live Drupal site or hosted CI service is required.

I verified this with PHP 8.4.27, Symfony Console 7.4.23, Symfony Process 7.4.22, Drush 13.8.1, and PHPUnit 11.5.58:

  • All 7 tests and 33 assertions pass, with no skips.
  • Both added CLI regression tests fail against unchanged upstream for the expected timeout/environment behavior and pass with this change.
  • PHP syntax checks pass. Composer validation passes with the existing license and unbounded-constraint warnings.

Closes #33.

The initial local test setup also contributes toward #38.

runCommand() picked Composer commands with a regex over the command line, so a Composer call written
another way would silently keep the default timeout. Now runCommand() takes the timeout and the
environment, and runComposer(), which every Composer call uses, passes the configured ones. The 2
second limit of the recursive "why" becomes a runComposer() argument.
# Conflicts:
#	src/UpdaterCommand.php
… the tests

Composer exports it when running "composer test", so the updater passed it on to every call and the timeout test could not tell whether the updater was the one setting it.
@omarlopesino
omarlopesino merged commit 152f284 into Metadrop:1.x Nov 17, 2026
7 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.

Make composer process timeout configurable via .drupal-updater.yml

2 participants