-
-
Notifications
You must be signed in to change notification settings - Fork 25
Fix timing precision issues in delay tests on Windows #72
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
Conversation
✅ Deploy Preview for fetch-php canceled.
|
Co-authored-by: Thavarshan <10804999+Thavarshan@users.noreply.github.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
@copilot please check and fix this failing CI test as well. Please address all similar tests in other areas of the codebase. |
Co-authored-by: Thavarshan <10804999+Thavarshan@users.noreply.github.com>
Fixed the failing test |
Pull Request
Description
What does this PR do?
Fixes flaky delay-related tests on Windows CI. The tests were failing intermittently because Windows timer resolution can cause
microtime()to report slightly less than the expected delay (e.g., 49.997ms instead of 50ms, or 9.38ms instead of 10ms).Fixes https://github.com/Thavarshan/fetch-php/actions/runs/19784949325/job/56698436697
Type of Change
Changes Made
test_fake_with_delay(MockingIntegrationTest.php)test_executes_response_with_delay(MockResponseTest.php)Testing
How has this been tested?
Test Environment:
Documentation
Checklist
Additional Notes
Windows has lower timer resolution than Linux/macOS. A 2ms tolerance is sufficient to account for this while still validating the delay mechanism works correctly. Reviewed all other timing-related tests in the codebase - only tests that measure actual elapsed time against an expected delay were affected. Other tests (ManagesRetriesTest, ConnectionPoolTest, CacheTest) check calculated values or timestamps rather than elapsed durations, so they don't need the same fix.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.