You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to use Coyote to check for bugs in a library of mine, but some of my code is using System.Threading.SemaphoreSlim, which currently isn't supported.
It seems that there is a compatible implementation already available here: https://github.com/microsoft/coyote/blob/main/Source/Core/Tasks/Locks/Semaphore.cs
My code seems to work normally when I manually rewrite it to use this implementation.
Could a rewrite rule be added to directly support code which uses SemaphoreSlim, or is there a detail I've missed?
Thanks for trying out Coyote Cameron Martens (@camerondm9), and raising this issue! No you are right, if you manually switch to the Semaphore implementation available in Coyote then it will indeed work, it is just that we did not add yet a rewriting pass to automate this type.
We basically used to ask developers to manually change the default .NET types to the "concurrency testable" versions provided by Coyote, like this Semaphore one, but a few months ago we introduced rewriting to fully automate this process and make it much more user friendly. So far we have focused on the most common TPL types, but we are happy to add rewriting for SemaphoreSlim, as its already there after all :)
I will ping you once I add it to rewriting. Btw, we also welcome (and would love) contributions if tackling this was something that you would be interested to try out! Feel free to let me know in that case.
Activity
pdeligia commentedon Apr 22, 2021
Thanks for trying out Coyote Cameron Martens (@camerondm9), and raising this issue! No you are right, if you manually switch to the
Semaphoreimplementation available in Coyote then it will indeed work, it is just that we did not add yet a rewriting pass to automate this type.We basically used to ask developers to manually change the default .NET types to the "concurrency testable" versions provided by Coyote, like this Semaphore one, but a few months ago we introduced rewriting to fully automate this process and make it much more user friendly. So far we have focused on the most common TPL types, but we are happy to add rewriting for
SemaphoreSlim, as its already there after all :)I will ping you once I add it to rewriting. Btw, we also welcome (and would love) contributions if tackling this was something that you would be interested to try out! Feel free to let me know in that case.
pdeligia commentedon Sep 13, 2022
Closing as this is duplicate of #368, this is now supported and will be available in the next release.