Skip to content

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

Merged
merged 2 commits into from
Jun 4, 2025
Merged

Fix PAL tests #116197

merged 2 commits into from
Jun 4, 2025

Conversation

jkotas
Copy link
Member

@jkotas jkotas commented Jun 1, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings June 1, 2025 18:53
Copy link
Contributor

@Copilot Copilot AI left a 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);
Copy link
Member Author

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

Copy link
Member Author

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);
Copy link
Member Author

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.

@jkotas jkotas requested a review from AaronRobinsonMSFT June 1, 2025 18:56
@jkotas
Copy link
Member Author

jkotas commented Jun 1, 2025

/azp run runtime-coreclr outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jkotas
Copy link
Member Author

jkotas commented Jun 1, 2025

/azp run runtime-coreclr outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jkotas
Copy link
Member Author

jkotas commented Jun 4, 2025

/ba-g known issue filled

@jkotas jkotas merged commit 73882e8 into dotnet:main Jun 4, 2025
143 of 148 checks passed
@jkotas jkotas deleted the fix-pal-tests branch June 4, 2025 15:37
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants