Skip to content

Increase script sleep in FPM process idle test #7561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions sapi/fpm/tests/proc-idle-timeout.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ FPM: Process manager config pm.process_idle_timeout
<?php
include "skipif.inc";
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
echo "skip Test fails in CI\n";
?>
--FILE--
<?php
Expand All @@ -24,18 +23,18 @@ EOT;

$code = <<<EOT
<?php
usleep(200);
usleep(300000);
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,
]);
// wait for process idle timeout
sleep(6);
sleep(5);
$tester->status([
'total processes' => 1,
]);
Expand Down
8 changes: 5 additions & 3 deletions sapi/fpm/tests/tester.inc
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ class Tester
* @param string|null $successMessage
* @param string|null $errorMessage
* @param bool $connKeepAlive
* @param int $readTimeout
* @return Response[]
* @throws \Exception
*/
Expand All @@ -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);
Expand All @@ -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();
}
Expand Down