1--TEST--
2FPM: GH-8885 - access.log with stderr begins to write logs to error_log after daemon reload
3--SKIPIF--
4<?php
5include "skipif.inc";
6FPM\Tester::skipIfRoot();
7?>
8--FILE--
9<?php
10
11require_once "tester.inc";
12
13$cfg = <<<EOT
14[global]
15error_log = {{FILE:LOG}}
16pid = {{FILE:PID}}
17[unconfined]
18listen = {{ADDR}}
19access.log=/dev/stderr
20ping.path = /ping
21ping.response = pong
22pm = dynamic
23pm.max_children = 5
24pm.start_servers = 1
25pm.min_spare_servers = 1
26pm.max_spare_servers = 3
27EOT;
28
29$tester = new FPM\Tester($cfg);
30$tester->start(forceStderr: false);
31$tester->expectNoLogMessages();
32$tester->switchLogSource('{{FILE:LOG}}');
33$tester->expectLogStartNotices();
34$tester->ping();
35$tester->switchLogSource('{{MASTER:OUT}}');
36$tester->expectLogPattern('/127.0.0.1 .* "GET \/ping" 200/');
37$tester->reload();
38$tester->switchLogSource('{{FILE:LOG}}');
39$tester->expectLogReloadingNotices();
40$tester->ping();
41$tester->switchLogSource('{{MASTER:OUT}}');
42$tester->expectLogPattern('/127.0.0.1 .* "GET \/ping" 200/');
43$tester->switchLogSource('{{FILE:LOG}}');
44$tester->terminate();
45$tester->expectLogTerminatingNotices();
46$tester->switchLogSource('{{MASTER:OUT}}');
47$tester->expectNoLogMessages();
48$tester->close();
49?>
50Done
51--EXPECT--
52Done
53--CLEAN--
54<?php
55require_once "tester.inc";
56FPM\Tester::clean();
57?>
58