Fix intermittent failures in PAL tests#115958
Merged
jkotas merged 1 commit intodotnet:mainfrom May 26, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates several PAL threading tests to use high-resolution tick measurements and converts raw tick deltas into milliseconds to reduce timing-related test flakiness.
- Replaced
minipal_lowres_ticks()withminipal_hires_ticks() - Divided tick differences by
(minipal_hires_tick_frequency() / 1000)to produce millisecond values - Applied these changes consistently across WaitForSingleObject, WaitForMultipleObjectsEx, SleepEx, and Sleep test cases
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.cpp | Swap low-res ticks for high-res and convert to ms |
| src/coreclr/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/WFSOExSemaphoreTest.cpp | Swap low-res ticks for high-res and convert to ms |
| src/coreclr/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.cpp | Swap low-res ticks for high-res and convert to ms |
| src/coreclr/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/test2.cpp | Swap low-res ticks for high-res and convert to ms |
| src/coreclr/pal/tests/palsuite/threading/SleepEx/test2/test2.cpp | Swap low-res ticks for high-res and convert to ms |
| src/coreclr/pal/tests/palsuite/threading/SleepEx/test1/test1.cpp | Swap low-res ticks for high-res and convert to ms |
| src/coreclr/pal/tests/palsuite/threading/Sleep/test2/sleep.cpp | Swap low-res ticks for high-res and convert to ms |
| src/coreclr/pal/tests/palsuite/threading/Sleep/test1/Sleep.cpp | Swap low-res ticks for high-res and convert to ms |
...reclr/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.cpp
Show resolved
Hide resolved
...pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/WFSOExSemaphoreTest.cpp
Show resolved
Hide resolved
...coreclr/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.cpp
Show resolved
Hide resolved
src/coreclr/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/test2.cpp
Show resolved
Hide resolved
Member
Author
|
Example of a failure: https://helix.dot.net/api/2019-06-17/jobs/30c36749-2cf4-4fa9-a5bb-71292b5a72a4/workitems/PALTests/console |
Member
Author
|
/azp run runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
cc @huoyaoyuan |
This was referenced May 24, 2025
Open
AaronRobinsonMSFT
approved these changes
May 25, 2025
Member
AaronRobinsonMSFT
left a comment
There was a problem hiding this comment.
Le sigh... Thank you.
Member
Author
|
/ba-g known issue #115640 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixing regression introduced by #115877. The lowres timestamp has a rounding error that makes the test fail intermittently. Switch back to highres timestamp.