Skip to content

sapi/cgi/tests/005.phpt test is failing on Alpine linux #9140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mvorisek opened this issue Jul 25, 2022 · 5 comments
Closed

sapi/cgi/tests/005.phpt test is failing on Alpine linux #9140

mvorisek opened this issue Jul 25, 2022 · 5 comments

Comments

@mvorisek
Copy link
Contributor

Description

test log:

 ========DIFF========
001+ string(51) "Interactive mode enabled
002+ No input file specified.
003+ 
004+ "
005+ string(51) "Interactive mode enabled
     string(51) "No input file specified.
006+ No input file specified.
001- string(51) "No input file specified.
002- Interactive mode enabled
     
     "
005- string(51) "No input file specified.
006- Interactive mode enabled
007- 
008- "
     Done
========DONE========
FAIL using invalid combinations of cmdline options [sapi/cgi/tests/005.phpt] 

CI: https://github.com/php/php-src/runs/7506106345?check_suite_focus=true#step:10:4007

the error messages are swapped on Alpine linux and the expected output thus does not match - can this be unified in the php-src?

PHP Version

master

Operating System

Alpine linux

@mvorisek mvorisek changed the title tests-debug/sapi/cgi/tests/005.phpt test is failing on Alpine linux sapi/cgi/tests/005.phpt test is failing on Alpine linux Jul 25, 2022
@arnaud-lb
Copy link
Member

arnaud-lb commented Jul 28, 2022

The string Interactive mode enabled is printed to stdout, and No input file specified. to stderr. As a result, the order is undefined.

Adding 2>&1 would make the order predictable.

@mvorisek
Copy link
Contributor Author

Do you want to submit a PR or should I submit it?

@mvorisek
Copy link
Contributor Author

Maybe we can pipe to null and test twice, once for stdout, once for stderr.

@arnaud-lb
Copy link
Member

I was wrong, I misread the code: both are sent to stdout.

What actually happens is that printf("Interactive mode enabled\n\n") is buffered in glibc, so it ends up being printed later. This could be fixed by a fflush(stdout) after printf.

Do you want to submit a PR or should I submit it?

Go ahead if you want :)

@mvorisek
Copy link
Contributor Author

No worries and thanks for looking into it! I will submit PR shortly.

mvorisek added a commit to mvorisek/php-src that referenced this issue Jul 28, 2022
mvorisek added a commit to mvorisek/php-src that referenced this issue Jul 28, 2022
mvorisek added a commit to mvorisek/php-src that referenced this issue Jul 28, 2022
@bukka bukka closed this as completed in bd3cd6a Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants