From c1bba87f7901b55be4cea4471de5e60c007312d6 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Wed, 28 Oct 2026 12:15:03 +0100 Subject: [PATCH] Fix flaky FPM log-bwd-multiple-msgs-stdout-stderr test and remove XFAIL The end of request flush command is written only to the stderr pipe so a stdout message without a trailing newline is terminated only when the master sees the switch to stderr. If the master is not scheduled between the two requests (slow CI), it reads both stdout chunks at once and logs them as a single "msg 1 - msg 1 - " line which made the test fail. Check the log lines after each request so the master always drains the pipes before the next request is sent. This also verifies the output of the second request which was previously not checked. --- sapi/fpm/tests/log-bwd-multiple-msgs-stdout-stderr.phpt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sapi/fpm/tests/log-bwd-multiple-msgs-stdout-stderr.phpt b/sapi/fpm/tests/log-bwd-multiple-msgs-stdout-stderr.phpt index 4a8fbf3a56e2..b4ff793b9f3a 100644 --- a/sapi/fpm/tests/log-bwd-multiple-msgs-stdout-stderr.phpt +++ b/sapi/fpm/tests/log-bwd-multiple-msgs-stdout-stderr.phpt @@ -2,8 +2,6 @@ FPM: Buffered worker output decorated log with multiple continuous messages (stdout/stderr mixed) --SKIPIF-- ---XFAIL-- -Fails intermittently --FILE-- start(); $tester->expectLogStartNotices(); +// Check logs after each request so a slow master cannot merge the stdout msgs. $tester->request()->expectEmptyBody(); +$tester->expectLogLine('msg 1 - ', false); +$tester->expectLogLine('msg 2 - msg 3', true); $tester->request()->expectEmptyBody(); $tester->expectLogLine('msg 1 - ', false); $tester->expectLogLine('msg 2 - msg 3', true);