Skip to content
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

Added reproduction spec for missing custom mailbox when using DI #7402

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

Aaronontheweb
Copy link
Member

@Aaronontheweb Aaronontheweb commented Dec 4, 2024

Changes

Based on this Discord thread, https://discord.com/channels/974500337396375553/1313882787350188124 - it looks like there's a bug with using custom mailboxes with DI'd actors. This PR tests for the issue.

Ultimately we were not able to reproduce it after we corrected the test assertion for the custom mailbox.

@@ -10,6 +10,7 @@
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("Akka.Cluster.Tests.MultiNode")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("Akka.Cluster.Tools")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("Akka.DependencyInjection")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("Akka.DependencyInjection.Tests")]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to expose friend assembly bits here in order to make the test workable, and that's what triggered the API check-in.


// Verify that the custom mailbox was used
var actorRef = (RepointableActorRef)actor;
actorRef.MailboxType.GetType().Should().Be(typeof(CustomMailbox));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed how we assert for the presence of the custom mailbox to match what we do in the core AkkaSpecs and this passes now - I was also able to verify with the debugger that the custom mailbox was used.

@Aaronontheweb Aaronontheweb enabled auto-merge (squash) December 4, 2024 16:37
@Aaronontheweb Aaronontheweb merged commit 1f448e9 into akkadotnet:dev Dec 4, 2024
9 of 12 checks passed
@Aaronontheweb Aaronontheweb deleted the di-mailbox-specs branch December 4, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant