1--TEST--
2FPM: Buffered worker output decorated log with multiple continuous messages (stdout/stderr mixed)
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 = dynamic
16pm.max_children = 5
17pm.start_servers = 1
18pm.min_spare_servers = 1
19pm.max_spare_servers = 3
20catch_workers_output = yes
21EOT;
22
23$code = <<<EOT
24<?php
25file_put_contents('php://stdout', "msg 1 - ");
26usleep(1);
27file_put_contents('php://stderr', "msg 2 - ");
28usleep(1);
29file_put_contents('php://stderr', "msg 3");
30EOT;
31
32$tester = new FPM\Tester($cfg, $code);
33$tester->start();
34$tester->expectLogStartNotices();
35$tester->request()->expectEmptyBody();
36$tester->request()->expectEmptyBody();
37$tester->terminate();
38$tester->expectLogLine('msg 1 - ', false);
39$tester->expectLogLine('msg 2 - msg 3', true);
40$tester->close();
41
42?>
43Done
44--EXPECT--
45Done
46--CLEAN--
47<?php
48require_once "tester.inc";
49FPM\Tester::clean();
50?>
51