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
Support for this needs to be implemented in BoDi, because that's what performs the actual disposal. To enable this, I've created SpecFlowOSS/BoDi#51
If that PR gets accepted into BoDi, the minimal implementation of this feature in SpecFlow would just be to upgrade to the version of BoDi that supports IAsyncDisposable.
However, it would be better to do slightly more than that, because in that minimal case, SpecFlow projects would continue to dispose containers using non-async IDisposable.Dispose. And although SpecFlowOSS/BoDi#51 does support disposing IAsyncDisposable objects even when the container is disposed synchronously, this inevitably lead to "sync over async", which is best avoided.
So it would be better to modify SpecFlow so that when it disposes the BoDi container, it does so with IAsyncDisposable.DisposeAsync, returning a Task up to whichever test framework is in use. That way it's async all the way up, and we avoid any risk of sync over async.
But it would be good to get a steer on whether you're actually interested in taking such a PR before I do the work!
The text was updated successfully, but these errors were encountered:
Link to Feature Request
https://support.specflow.org/hc/en-us/community/posts/4410211637521-Support-IAsyncDisposable-in-bindings
Implementation Idea
Support for this needs to be implemented in BoDi, because that's what performs the actual disposal. To enable this, I've created SpecFlowOSS/BoDi#51
If that PR gets accepted into BoDi, the minimal implementation of this feature in SpecFlow would just be to upgrade to the version of BoDi that supports
IAsyncDisposable
.However, it would be better to do slightly more than that, because in that minimal case, SpecFlow projects would continue to dispose containers using non-async
IDisposable.Dispose
. And although SpecFlowOSS/BoDi#51 does support disposingIAsyncDisposable
objects even when the container is disposed synchronously, this inevitably lead to "sync over async", which is best avoided.So it would be better to modify SpecFlow so that when it disposes the BoDi container, it does so with
IAsyncDisposable.DisposeAsync
, returning aTask
up to whichever test framework is in use. That way it'sasync
all the way up, and we avoid any risk of sync over async.But it would be good to get a steer on whether you're actually interested in taking such a PR before I do the work!
The text was updated successfully, but these errors were encountered: