Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes consistency in PAL threading tests by removing stray semicolons and normalizing time delta calculations to milliseconds across various Wait/Sleep test suites.
- Ensures all
ThreadWaitDelta/TimeDeltacomputations divide ticks by(minipal_hires_tick_frequency()/1000)for consistent timing. - Removes duplicated semicolons at the end of delta assignment statements.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| WFSOExThreadTest/WFSOExThreadTest.cpp | Normalized wait delta, removed extra semicolon |
| WFSOExSemaphoreTest/WFSOExSemaphoreTest.cpp | Normalized wait delta, removed extra semicolon |
| WFSOExMutexTest/WFSOExMutexTest.cpp | Added normalization for mutex wait delta |
| WaitForMultipleObjectsEx/test2/test2.cpp | Normalized wait delta, removed extra semicolon |
| SleepEx/test2/test2.cpp | Normalized sleep delta, removed extra semicolon |
| SleepEx/test1/test1.cpp | Normalized sleep delta, removed extra semicolon |
| Sleep/test2/sleep.cpp | Normalized sleep delta, removed extra semicolon |
| Sleep/test1/Sleep.cpp | Normalized sleep delta, removed extra semicolon |
Comments suppressed due to low confidence (1)
src/coreclr/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.cpp:187
- The repeated time delta conversion appears across multiple tests; consider extracting this calculation into a shared helper or macro to reduce duplication and improve consistency.
ThreadWaitDelta_WFSOExThreadTest = (NewTimeStamp - OldTimeStamp) / (minipal_hires_tick_frequency() / 1000);
jkotas
commented
Jun 1, 2025
| } | ||
|
|
||
| ThreadWaitDelta_WFSOExMutexTest = NewTimeStamp - OldTimeStamp; | ||
| ThreadWaitDelta_WFSOExMutexTest = (NewTimeStamp - OldTimeStamp) / (minipal_hires_tick_frequency() / 1000); |
Member
Author
There was a problem hiding this comment.
@AaronRobinsonMSFT This was accidentally deleted in #115858
Member
Author
There was a problem hiding this comment.
Before this fix, it is failing with:
Thread waited for 2138803459 ms! (Acceptable delta: 300)
FAILED: threading/WaitForSingleObject/WFSOExMutexTest/paltest_waitforsingleobject_wfsoexmutextest. Exit code: 1
jkotas
commented
Jun 1, 2025
| } | ||
|
|
||
| ThreadWaitDelta_WFMO_test2 = (NewTimeStamp - OldTimeStamp) / (minipal_hires_tick_frequency() / 1000);; | ||
| ThreadWaitDelta_WFMO_test2 = (NewTimeStamp - OldTimeStamp) / (minipal_hires_tick_frequency() / 1000); |
Member
Author
There was a problem hiding this comment.
Fixing mistake in my regex.
Member
Author
|
/azp run runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This was referenced Jun 1, 2025
janvorli
approved these changes
Jun 4, 2025
Member
Author
|
/ba-g known issue filled |
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.
No description provided.