From 4c11fae5419968227d859dfade47bf0819dabcd3 Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Wed, 28 Sep 2022 22:18:16 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=20WIP:=20Run=20shell=20commands=20?= =?UTF-8?q?in=20parallel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpmon-tests/Next/SystemShellTest.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/phpmon-tests/Next/SystemShellTest.swift b/phpmon-tests/Next/SystemShellTest.swift index bab6967..8e411bc 100644 --- a/phpmon-tests/Next/SystemShellTest.swift +++ b/phpmon-tests/Next/SystemShellTest.swift @@ -60,4 +60,18 @@ class SystemShellTest: XCTestCase { wait(for: [expectation], timeout: 5.0) } + + func test_system_processes_run_in_parallel() async { + let expectation = XCTestExpectation(description: #function) + + let thing = { + await Shell.quiet("php -r \"usleep(700);\"") + await Shell.quiet("php -r \"usleep(700);\"") + await Shell.quiet("php -r \"usleep(700);\"") + expectation.fulfill() + } + + await thing() + wait(for: [expectation], timeout: 1.0) + } }