Skip to content
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 incorrect assert in AbandonExisting test case #55198

Merged
merged 1 commit into from
Jul 7, 2021
Merged

Fix incorrect assert in AbandonExisting test case #55198

merged 1 commit into from
Jul 7, 2021

Conversation

uweigand
Copy link
Contributor

@uweigand uweigand commented Jul 6, 2021

  • Handle the case where the "notAbandonedWait" event is not signaled

This test case wants to assert that if the abandoned mutex comes after the notAbandonedWait event in the WaitAny call, the event should have been reported first. But that is only true in those test instances where isNotAbandonedWaitObjectSignaled is true, otherwise that event isn't even signaled.

* Handle the case where the "notAbandonedWait" event is not signaled
@ghost
Copy link

ghost commented Jul 6, 2021

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

Issue Details
  • Handle the case where the "notAbandonedWait" event is not signaled

This test case wants to assert that if the abandoned mutex comes after the notAbandonedWait event in the WaitAny call, the event should have been reported first. But that is only true in those test instances where isNotAbandonedWaitObjectSignaled is true, otherwise that event isn't even signaled.

Author: uweigand
Assignees: -
Labels:

area-System.Threading

Milestone: -

@jkotas
Copy link
Member

jkotas commented Jul 7, 2021

Why is the test passing on CoreCLR Windows and Linux without this change? It sounds like there is behavior difference between CoreCLR and Mono.

@uweigand
Copy link
Contributor Author

uweigand commented Jul 7, 2021

Why is the test passing on CoreCLR Windows and Linux without this change? It sounds like there is behavior difference between CoreCLR and Mono.

As the comment says, it's unspecified which of the two abandoned mutexes (m or m2) will be signaled first. This incorrect assertion is only present in the path where m2 is signaled first; I assume that on platforms where the test passes, it just so happens that m is always (or mostly?) signaled first.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, sounds good. Thank you!

@jkotas jkotas merged commit 974e1af into dotnet:main Jul 7, 2021
@uweigand uweigand deleted the mutextestfix branch July 14, 2021 12:20
@ghost ghost locked as resolved and limited conversation to collaborators Aug 13, 2021
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.

3 participants