-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Fix PAL tests #116197
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
Fix PAL tests #116197
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
/TimeDelta
computations 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);
@@ -204,7 +204,7 @@ DWORD PALAPI WaiterProc_WFSOExMutexTest(LPVOID lpParameter) | |||
"Expected return of WAIT_TIMEOUT, got %d.\n", ret); | |||
} | |||
|
|||
ThreadWaitDelta_WFSOExMutexTest = NewTimeStamp - OldTimeStamp; | |||
ThreadWaitDelta_WFSOExMutexTest = (NewTimeStamp - OldTimeStamp) / (minipal_hires_tick_frequency() / 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AaronRobinsonMSFT This was accidentally deleted in #115858
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -176,7 +176,7 @@ DWORD PALAPI WaiterProc_WFMO_test2(LPVOID lpParameter) | |||
"Expected return of WAIT_TIMEOUT, got %d.\n", ret); | |||
} | |||
|
|||
ThreadWaitDelta_WFMO_test2 = (NewTimeStamp - OldTimeStamp) / (minipal_hires_tick_frequency() / 1000);; | |||
ThreadWaitDelta_WFMO_test2 = (NewTimeStamp - OldTimeStamp) / (minipal_hires_tick_frequency() / 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing mistake in my regex.
/azp run runtime-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
/ba-g known issue filled |
No description provided.