Skip to content

Commit 8e34059

Browse files
committed
Add test for split flush
1 parent 3cab59d commit 8e34059

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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', 1022) . "\0fscf\0");
27+
EOT;
28+
29+
$tester = new FPM\Tester($cfg, $code);
30+
$tester->start();
31+
$tester->expectLogStartNotices();
32+
$tester->request()->expectEmptyBody();
33+
$tester->terminate();
34+
var_dump($tester->getLastLogLine() === str_repeat('a', 1022) . "\n");
35+
$tester->close();
36+
37+
?>
38+
Done
39+
--EXPECT--
40+
bool(true)
41+
Done
42+
--CLEAN--
43+
<?php
44+
require_once "tester.inc";
45+
FPM\Tester::clean();
46+
?>
47+
--XFAIL--
48+
Split flush not implemented yet

sapi/fpm/tests/log-dwp-limit-1000-msg-2000.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ Done
4444
<?php
4545
require_once "tester.inc";
4646
FPM\Tester::clean();
47-
?>
47+
?>

0 commit comments

Comments
 (0)