Skip to content

test(pdo_firebird): Fix the dummy server running on localhost to IPv4 - #16115

Merged
ndossche merged 1 commit into
php:masterfrom
KentarouTakeda:fix-firebird-test-local-server
Sep 29, 2024
Merged

ndossche merged 1 commit into
php:masterfrom
KentarouTakeda:fix-firebird-test-local-server

Conversation

@KentarouTakeda

@KentarouTakeda KentarouTakeda commented Sep 29, 2024 •

Copy link
Copy Markdown
Contributor

This is related to #16113.

In the pdo_firebird test, a dummy server was created on localhost using stream_socket_server() to test for error responses that do not normally occur.

stream_socket_get_name() was used to generate the name of the dummy server, but this function seems to return the IPv6 address ::1 even in host environments where IPv6 is not available. As a result, in certain environments it was not possible to connect to the dummy server, and the test failed.

This problem is solved by creating a server on 127.0.0.1 and fixing it to IPv4, rather than creating it on localhost and leaving the choice of IPv6 or IPv4 to stream_socket_get_name().

@KentarouTakeda

Copy link
Copy Markdown
Contributor Author

Note: The issue fixed by this pull request potentially existed before #16113.

When I created #12677 in the past, I encountered the exact same test failure in the docker environment I personally use. I left it as it was because it didn't reproduce in CI, but after seeing #16113, I realized the cause.

I'm submitting screenshots of before and after the fix for your reference.

  • Before fix - fail
    before-fix

  • After fix - pass
    after-fix

@ndossche ndossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! This looks good to me but I'll wait for Saki to confirm.
I filed an issue for stream_socket_get_name(): #16117

@SakiTakamachi SakiTakamachi left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@ndossche
ndossche merged commit fec2055 into php:master Sep 29, 2024
@KentarouTakeda
KentarouTakeda deleted the fix-firebird-test-local-server branch September 23, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants