Skip to content

Fix incorrect assert in AbandonExisting test case#55198

Merged
jkotas merged 1 commit into
dotnet:mainfrom
uweigand:mutextestfix
Jul 7, 2021
Merged

Fix incorrect assert in AbandonExisting test case#55198
jkotas merged 1 commit into
dotnet:mainfrom
uweigand:mutextestfix

Conversation

@uweigand

@uweigand uweigand commented Jul 6, 2021

Copy link
Copy Markdown
Contributor
  • 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 ghost added the area-System.Threading label Jul 6, 2021
@ghost

ghost commented Jul 6, 2021

Copy link
Copy Markdown

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

jkotas commented Jul 7, 2021

Copy link
Copy Markdown
Member

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

uweigand commented Jul 7, 2021

Copy link
Copy Markdown
Contributor Author

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.

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

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