Youssef Victor
Youssef Victor
Closing stale PR.
@RobSwDev We recently shipped `ConditionBaseAttribute` along with `OSConditionAttribute`. Does using these attribute help with proper conditioning and not needing to inherit from `STAThreadAttribute` for your case?
Yes. If `Mode` is `Exclude`, it will run when `ShouldRun` returns false. The implementation of `ShouldRun` should be done with "include" mode in mind. If you are curious about the...
Thanks for your input @RobSwDev. We may end up not sealing the attribute, but slightly have a break in behavior in v4. We will likely make it such that Execute...
`ConditionBaseAttribute` unfortunately cannot access `TestContext`. @nohwnd Do you think it's worth breaking the public API for v4 to support this case?
Unfortunately, TestContext isn't available to ConditionBaseAttribute :(
Ping @nohwnd for review
> What is the benefit that this change brings? Is it to make sure that we are respecting the cancellation and don't get stuck in subsequent code that handles the...
I personally don't see a perf concern here. However, for our specific case (at least for the implementation that exists *today*, there is not much difference between returning vs throwing....
*At least* for `ConsumeAsync`, while we are already just doing a `return;`, we will then get to here: https://github.com/microsoft/testfx/blob/5bd7584ea1def491ac26f9f26fec5b9b78b38bb5/src/Platform/Microsoft.Testing.Platform/Messages/ChannelConsumerDataProcessor.cs#L57 then .NET will do this: https://github.com/dotnet/runtime/blob/f6b93319242155a72801a7bb4bc92faac2ada1a3/src/libraries/System.Threading.Channels/src/System/Threading/Channels/SingleConsumerUnboundedChannel.cs#L72-L75 So, when awaiting the canceled...