1--TEST--
2FPM: Buffered worker output decorated log with multiple continuous messages (stdout/stderr mixed)
3--SKIPIF--
4<?php include "skipif.inc"; ?>
5--XFAIL--
6Fails intermittently
7--FILE--
8<?php
9
10require_once "tester.inc";
11
12$cfg = <<<EOT
13[global]
14error_log = {{FILE:LOG}}
15[unconfined]
16listen = {{ADDR}}
17pm = dynamic
18pm.max_children = 5
19pm.start_servers = 1
20pm.min_spare_servers = 1
21pm.max_spare_servers = 3
22catch_workers_output = yes
23EOT;
24
25$code = <<<EOT
26<?php
27file_put_contents('php://stdout', "msg 1 - ");
28usleep(1);
29file_put_contents('php://stderr', "msg 2 - ");
30usleep(1);
31file_put_contents('php://stderr', "msg 3");
32EOT;
33
34$tester = new FPM\Tester($cfg, $code);
35$tester->start();
36$tester->expectLogStartNotices();
37$tester->request()->expectEmptyBody();
38$tester->request()->expectEmptyBody();
39$tester->expectLogLine('msg 1 - ', false);
40$tester->expectLogLine('msg 2 - msg 3', true);
41$tester->terminate();
42$tester->close();
43
44?>
45Done
46--EXPECT--
47Done
48--CLEAN--
49<?php
50require_once "tester.inc";
51FPM\Tester::clean();
52?>
53