Skip to content

Commit 636e54a

Browse files
committed
Merge branch 'PHP-8.1'
2 parents f893b55 + 79f0e48 commit 636e54a

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

sapi/fpm/tests/proc-idle-timeout.phpt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ FPM: Process manager config pm.process_idle_timeout
44
<?php
55
include "skipif.inc";
66
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
7-
echo "skip Test fails in CI\n";
87
?>
98
--FILE--
109
<?php
@@ -24,18 +23,18 @@ EOT;
2423

2524
$code = <<<EOT
2625
<?php
27-
usleep(200);
26+
usleep(300000);
2827
EOT;
2928

3029
$tester = new FPM\Tester($cfg, $code);
3130
$tester->start();
3231
$tester->expectLogStartNotices();
33-
$tester->multiRequest(2);
32+
$tester->multiRequest(2, null, null, null, false, 7000);
3433
$tester->status([
3534
'total processes' => 2,
3635
]);
3736
// wait for process idle timeout
38-
sleep(6);
37+
sleep(5);
3938
$tester->status([
4039
'total processes' => 1,
4140
]);

sapi/fpm/tests/tester.inc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ class Tester
624624
* @param string|null $successMessage
625625
* @param string|null $errorMessage
626626
* @param bool $connKeepAlive
627+
* @param int $readTimeout
627628
* @return Response[]
628629
* @throws \Exception
629630
*/
@@ -632,7 +633,8 @@ class Tester
632633
string $address = null,
633634
string $successMessage = null,
634635
string $errorMessage = null,
635-
bool $connKeepAlive = false
636+
bool $connKeepAlive = false,
637+
int $readTimeout = 0
636638
) {
637639
if ($this->hasError()) {
638640
return new Response(null, true);
@@ -658,8 +660,8 @@ class Tester
658660
];
659661
}, $requests);
660662

661-
$responses = array_map(function ($conn) {
662-
$response = new Response($conn['client']->wait_for_response_data($conn['requestId']));
663+
$responses = array_map(function ($conn) use ($readTimeout) {
664+
$response = new Response($conn['client']->wait_for_response_data($conn['requestId'], $readTimeout));
663665
if ($this->debug) {
664666
$response->debugOutput();
665667
}

0 commit comments

Comments
 (0)