Replace fixed test delays with deterministic synchronization - #22948
Draft
NickSdot wants to merge 3 commits into
Draft
Replace fixed test delays with deterministic synchronization#22948NickSdot wants to merge 3 commits into
NickSdot wants to merge 3 commits into
Conversation
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.
Extracted from #22917.
Replaces fixed delays in filesystem, OPcache and proc_open() tests with deterministic synchronisation. Tests now advance timestamps explicitly, poll observable state with bounded timeouts, or use socket handshakes instead of waiting for assumed durations. This preserves the original assertions while reducing runtime and timing related flakiness.
Result
Values in seconds; measured on macOS.
-j1-j10Reproduction:
sapi/cli/php run-tests.php -q -j10 \ ext/opcache/tests/issue0140.phpt \ ext/standard/tests/file/001.phpt \ ext/standard/tests/file/lstat_stat_basic.phpt \ ext/standard/tests/file/lstat_stat_variation10.phpt \ ext/standard/tests/file/lstat_stat_variation11.phpt \ ext/standard/tests/file/lstat_stat_variation13.phpt \ ext/standard/tests/file/lstat_stat_variation15.phpt \ ext/standard/tests/file/lstat_stat_variation4.phpt \ ext/standard/tests/general_functions/bug39322.phpt \ ext/standard/tests/general_functions/proc_open_pipes1.phpt \ ext/standard/tests/general_functions/proc_open_pipes2.phpt \ ext/standard/tests/general_functions/proc_open_pipes3.phpt \ ext/standard/tests/general_functions/proc_open_sockets1.phpt \ ext/standard/tests/general_functions/proc_open_sockets2.phpt \ ext/standard/tests/general_functions/proc_open_sockets3.phpt