From 0b89f7d7482ede18f0954cce95e87f3ac51d67c2 Mon Sep 17 00:00:00 2001 From: Rick Lavoie Date: Thu, 22 Apr 2021 00:44:07 -0700 Subject: [PATCH] Speed up global_vars.php test Summary: global_vars.php test takes a long time with retranslate-all enabled because it spins up a number of HHVMs serially. Speed it up greatly by starting up the HHVMs in parallel. Reviewed By: oulgen Differential Revision: D27933474 fbshipit-source-id: 878a1f20ab2d7e883a57b3738d8d112a934f01b6 --- hphp/test/slow/global_vars/global_vars.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hphp/test/slow/global_vars/global_vars.php b/hphp/test/slow/global_vars/global_vars.php index 8bfed46b1a8..f74400b7a79 100644 --- a/hphp/test/slow/global_vars/global_vars.php +++ b/hphp/test/slow/global_vars/global_vars.php @@ -11,6 +11,7 @@ function entrypoint_global_vars(): void { $args = varray['', 'G', 'P', 'E', 'S', 'ES', 'ESCGP', 'CG']; + $processes = vec[]; foreach($args as $arg) { $descriptorspec = darray[ 0 => varray['pipe', 'r'], @@ -29,10 +30,12 @@ function entrypoint_global_vars(): void { echo "Failed to open: $cmd\n"; exit -1; } + $processes[] = tuple($proc, $pipes); + } - echo stream_get_contents($pipes[1]); - fclose($pipes[1]); - - proc_close($proc); + foreach ($processes as $proc) { + echo stream_get_contents($proc[1][1]); + fclose($proc[1][1]); + proc_close($proc[0]); } } -- 2.11.4.GIT