Skip to content

Commit

Permalink
Concurrency Tests - Update ExternalBatch for symfony/proces v4.1+
Browse files Browse the repository at this point in the history
Before
------

`api_v3_JobProcessMailingTest::testConcurrency()` and `Civi\FlexMailer\ConcurrencyTest`
fail when executed on Drupal 10.

After
-----

Pass when executed on Drupal 10

Technical Details
-----------------

`symfony/process` v4.1 deprecated the usage of `new Process(string)` and
added `Process::fromShellCommandline(string)`. The `new Process(string)` was
dropped from v5.x and v6.x. So you get an unconditional failure on D10. (On
other platforms, it can also fail... depending on how you deal with
deprecations.)

In `civicrm-core:composer.json`, the minimum mversion of `symfony/process` is `4.4`.
So that means we can use the newer `Process::fromShellCommandline(string)`.
  • Loading branch information
totten committed Aug 15, 2023
1 parent 647267c commit 8ac67af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Civi/API/ExternalBatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public function createProcess($apiCall) {
$env = array_merge($this->env, [
'CIVICRM_SETTINGS' => $this->settingsPath,
]);
return new Process($command, $this->root, $env);
return Process::fromShellCommandline($command, $this->root, $env);
}

/**
Expand Down

0 comments on commit 8ac67af

Please sign in to comment.