Skip to content

Commit 22447ed

Browse files
committed
Add test for split fallback
1 parent 1233f18 commit 22447ed

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
--TEST--
2+
FPM: Buffered worker output plain log with msg with flush split in buffer
3+
--SKIPIF--
4+
<?php include "skipif.inc"; ?>
5+
--FILE--
6+
<?php
7+
8+
require_once "tester.inc";
9+
10+
$cfg = <<<EOT
11+
[global]
12+
error_log = {{FILE:LOG}}
13+
[unconfined]
14+
listen = {{ADDR}}
15+
pm = dynamic
16+
pm.max_children = 5
17+
pm.start_servers = 1
18+
pm.min_spare_servers = 1
19+
pm.max_spare_servers = 3
20+
catch_workers_output = yes
21+
decorate_workers_output = no
22+
EOT;
23+
24+
$code = <<<EOT
25+
<?php
26+
file_put_contents('php://stderr', str_repeat('a', 1021) . "\0fabc");
27+
EOT;
28+
29+
$tester = new FPM\Tester($cfg, $code);
30+
$tester->start();
31+
$tester->expectLogStartNotices();
32+
$tester->request()->expectEmptyBody();
33+
$tester->terminate();
34+
$lines = $tester->getLogLines(2);
35+
//var_dump($lines);
36+
var_dump($lines[0] === str_repeat('a', 1022) . "\0f\n");
37+
var_dump($lines[1] === "abc\n");
38+
$tester->close();
39+
40+
?>
41+
Done
42+
--EXPECT--
43+
bool(true)
44+
bool(true)
45+
Done
46+
--CLEAN--
47+
<?php
48+
require_once "tester.inc";
49+
FPM\Tester::clean();
50+
?>
51+
--XFAIL--
52+
Zero byte is not working in the split for some reason

0 commit comments

Comments
 (0)