1--TEST--
2FPM: GH-16932 - scoreboard fields are reset after the request
3--EXTENSIONS--
4pcntl
5--SKIPIF--
6<?php
7include "skipif.inc";
8?>
9--FILE--
10<?php
11
12require_once "tester.inc";
13
14$cfg = <<<EOT
15[global]
16error_log = {{FILE:LOG}}
17pid = {{FILE:PID}}
18[unconfined]
19listen = {{ADDR}}
20pm.status_path = /status
21pm = dynamic
22pm.max_children = 2
23pm.start_servers = 1
24pm.min_spare_servers = 1
25pm.max_spare_servers = 1
26EOT;
27
28$code = <<<EOT
29<?php
30echo "hi!";
31EOT;
32
33
34$tester = new FPM\Tester($cfg, $code);
35$tester->start(extensions: ['pcntl']);
36$tester->expectLogStartNotices();
37$tester->request();
38$tester->request();
39$tester->request();
40$tester->request();
41$tester
42    ->request(uri: '/status', query: 'json')
43    ->expectJsonBodyPatternForStatusField('accepted conn', '5');
44$tester->terminate();
45$tester->expectLogTerminatingNotices();
46$tester->close();
47
48?>
49Done
50--EXPECT--
51Done
52--CLEAN--
53<?php
54require_once "tester.inc";
55FPM\Tester::clean();
56?>
57