From 279889e06d38a94011ff5779baf26b1f36f3f3d1 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Tue, 5 Oct 2021 21:02:01 +0100 Subject: [PATCH 1/2] Increase script sleep in FPM process idle test --- sapi/fpm/tests/proc-idle-timeout.phpt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sapi/fpm/tests/proc-idle-timeout.phpt b/sapi/fpm/tests/proc-idle-timeout.phpt index a6d3395c14a84..3c638ea869f1a 100644 --- a/sapi/fpm/tests/proc-idle-timeout.phpt +++ b/sapi/fpm/tests/proc-idle-timeout.phpt @@ -4,7 +4,6 @@ FPM: Process manager config pm.process_idle_timeout --FILE-- status([ 'total processes' => 2, ]); // wait for process idle timeout -sleep(6); +sleep(5); $tester->status([ 'total processes' => 1, ]); From 60199221c3b046f695a8ddf8e08b849794ef93e7 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sun, 14 Nov 2021 21:10:47 +0000 Subject: [PATCH 2/2] Increase read timeout in FPM process idle test --- sapi/fpm/tests/proc-idle-timeout.phpt | 2 +- sapi/fpm/tests/tester.inc | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sapi/fpm/tests/proc-idle-timeout.phpt b/sapi/fpm/tests/proc-idle-timeout.phpt index 3c638ea869f1a..9f6d4377b8ce4 100644 --- a/sapi/fpm/tests/proc-idle-timeout.phpt +++ b/sapi/fpm/tests/proc-idle-timeout.phpt @@ -29,7 +29,7 @@ EOT; $tester = new FPM\Tester($cfg, $code); $tester->start(); $tester->expectLogStartNotices(); -$tester->multiRequest(2); +$tester->multiRequest(2, null, null, null, false, 7000); $tester->status([ 'total processes' => 2, ]); diff --git a/sapi/fpm/tests/tester.inc b/sapi/fpm/tests/tester.inc index 7868afc4ac1ba..5a190f0d39cbc 100644 --- a/sapi/fpm/tests/tester.inc +++ b/sapi/fpm/tests/tester.inc @@ -624,6 +624,7 @@ class Tester * @param string|null $successMessage * @param string|null $errorMessage * @param bool $connKeepAlive + * @param int $readTimeout * @return Response[] * @throws \Exception */ @@ -632,7 +633,8 @@ class Tester string $address = null, string $successMessage = null, string $errorMessage = null, - bool $connKeepAlive = false + bool $connKeepAlive = false, + int $readTimeout = 0 ) { if ($this->hasError()) { return new Response(null, true); @@ -658,8 +660,8 @@ class Tester ]; }, $requests); - $responses = array_map(function ($conn) { - $response = new Response($conn['client']->wait_for_response_data($conn['requestId'])); + $responses = array_map(function ($conn) use ($readTimeout) { + $response = new Response($conn['client']->wait_for_response_data($conn['requestId'], $readTimeout)); if ($this->debug) { $response->debugOutput(); }