Skip to content

Commit

Permalink
Add the actual test for FPM prod idle timeout test with 6s sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
bukka committed Oct 4, 2021
1 parent edfb347 commit 66a655f
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions sapi/fpm/tests/proc-idle-timeout.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
--TEST--
FPM: Process manager config pm.process_idle_timeout
--SKIPIF--
<?php
include "skipif.inc";
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
?>
--FILE--
<?php

require_once "tester.inc";

$cfg = <<<EOT
[global]
error_log = {{FILE:LOG}}
[unconfined]
listen = {{ADDR}}
pm = ondemand
pm.max_children = 3
pm.process_idle_timeout = 1
pm.status_path = /status
EOT;

$code = <<<EOT
<?php
usleep(200);
EOT;

$tester = new FPM\Tester($cfg, $code);
$tester->start();
$tester->expectLogStartNotices();
$tester->multiRequest(2);
$tester->status([
'total processes' => 2,
]);
// wait for process idle timeout
sleep(6);
$tester->status([
'total processes' => 1,
]);
$tester->terminate();
$tester->expectLogTerminatingNotices();
$tester->close();

?>
Done
--EXPECT--
Done
--CLEAN--
<?php
require_once "tester.inc";
FPM\Tester::clean();
?>

0 comments on commit 66a655f

Please sign in to comment.