xref: /PHP-8.4/sapi/fpm/tests/status-listen.phpt (revision 82296490)
1--TEST--
2FPM: Status listen test
3--SKIPIF--
4<?php include "skipif.inc"; ?>
5--FILE--
6<?php
7
8require_once "tester.inc";
9
10$cfg = <<<EOT
11[global]
12error_log = {{FILE:LOG}}
13[unconfined]
14listen = {{ADDR}}
15pm = static
16pm.max_children = 1
17pm.status_listen = {{ADDR[status]}}
18pm.status_path = /status
19EOT;
20
21$expectedStatusData = [
22    'pool'                 => 'unconfined',
23    'process manager'      => 'static',
24    'listen queue'         => 0,
25    'max listen queue'     => 0,
26    'idle processes'       => 1,
27    'active processes'     => 0,
28    'total processes'      => 1,
29    'max active processes' => 1,
30    'max children reached' => 0,
31    'slow requests'        => 0,
32];
33
34$tester = new FPM\Tester($cfg);
35$tester->start();
36$tester->expectLogStartNotices();
37$tester->request()->expectEmptyBody();
38usleep(100000);
39$tester->status($expectedStatusData, '{{ADDR[status]}}');
40$tester->terminate();
41$tester->expectLogTerminatingNotices();
42$tester->close();
43
44?>
45Done
46--EXPECT--
47Done
48--CLEAN--
49<?php
50require_once "tester.inc";
51FPM\Tester::clean();
52?>
53