CI: fix unstable test \ext\sockets\tests\socket_recvfrom_afpacket_no_port.phpt#22724
Merged
Conversation
Member
|
nit: this file is the "no optional port argument" contract test, and the original $bytes >= 60 asserted the return value of the 5-arg call. The new version only checks strlen($buf), dropping that assertion. Equal by construction today, so nothing breaks, but since recv_matching() already has the count, consider surfacing it via a by-ref param to keep the $bytes >= 60 check. |
devnexen
approved these changes
Jul 14, 2026
Member
Author
|
Should this be backported to 8.4? |
Member
|
no. packet filter support did not exist yet. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix flaky CI: https://github.com/php/php-src/actions/runs/29266463698/job/86873055452
When investigating, I've noticed that similar tests does not have this issue. Only
socket_recvfrom_afpacket_no_port.phptis flaky. Which makes me discover a shared logic in tests:https://github.com/php/php-src/blob/master/ext/sockets/tests/socket_sendto_recvfrom_afpacket_malformed.phpt#L28-L41
This allows the test to wait for a frame matching its own Ethernet header before asserting the returned address, so it no longer depends on incidental packet ordering. ETH_P_ALL sockets on loopback can observe unrelated localhost traffic.
And only this single flaky test doesn't have that logic. Let's add them.