-
Notifications
You must be signed in to change notification settings - Fork 263
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
[Testing Platform] IDataConsumer is never invoked #4588
Comments
The producer and consumer have the same UID so we don't send the data, see https://github.com/microsoft/testfx/blob/main/src/Platform/Microsoft.Testing.Platform/Messages/ChannelConsumerDataProcessor.cs#L63-L69. @MarcoRossignoli Do you recall why we did this? |
(y) Just what I was writing |
Hmm... Can we just let the extension decide that if it wants? They could just do: if (dataProducer.Uid == Uid)
{
return;
} |
Anyway not a blocker for now - I'll just use a different Uid for my extension. Thanks! 😄 |
Yeah keeping this open so we can discuss, I really don't recall why we added this check. Maybe it was making sense at first and then with the update of the design it's something that no longer makes sense. |
isn't it something about overhead of sending data via message bus that is unnecessary when the extension is one and the same? I think marco said something like this. |
Down this line, logically if I know my data I can consume "here". Producer and Consumer should not know each other. |
Then you have a class that's mixing responsibilities and not following SRP nicely? |
You can do it internally in your code that you fully own, you should not relay on the MessageBus, in future we can change the behavior of it, like block the push till all consumer consumed or something like that, why would you pay that cost to elaborate data that you're producing yourselves? Producer/Consumer in expensive and if I have my data I would elaborate the data I've produced next to the producer if I don't need to scale. Or if I need to scale I'd like to have full control on the threading. |
If it's extenal / IO then yeah, but isn't this all In-Process? Is it not just passing it from one class to another when extensions are in-process? |
The current implementation uses Channels in .NET and a BlockingCollection for .NET Framework so actually you pay the context switch (always for .NET Framework and for .NET Channels use the ThreadPool so could be done inline or on another thread). |
Ah okay. Best way to resolve this then would be to mention this logic in the documentation I think? |
Yeah I think it's better to keep the current behavior and improve documentation. |
Heya, I'm trying to write an extension point, and using the
IDataConsumer
, but it never seems to be invoked.Am I doing something wrong or is this a bug?
Repro:
Stick a breakpoint in
ConsumeAsync
and you'll see it's never hit, or just see that it doesn't print any console statements.The text was updated successfully, but these errors were encountered: