From 8ac67afe11de436daf815a6dd834a43198e631de Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 14 Aug 2023 17:01:20 -0700 Subject: [PATCH] Concurrency Tests - Update ExternalBatch for symfony/proces v4.1+ 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)`. --- Civi/API/ExternalBatch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Civi/API/ExternalBatch.php b/Civi/API/ExternalBatch.php index f9ea3ae69cf2..5a883950763a 100644 --- a/Civi/API/ExternalBatch.php +++ b/Civi/API/ExternalBatch.php @@ -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); } /**