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

Fix of duplication info message for unhandled message (#6532). #6730

Merged
merged 1 commit into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// </copyright>
//-----------------------------------------------------------------------

using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Akka.Actor;
using Akka.Event;
Expand All @@ -32,7 +31,7 @@ protected override void SendRawLogEventMessage(object message)
public async Task Unhandled_message_should_produce_info_message()
{
await EventFilter
.Info(new Regex("^Unhandled message from"))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This regex hides out duplicated message

.Info()
.ExpectOneAsync(() => {
_unhandledMessageActor.Tell("whatever");
return Task.CompletedTask;
Expand Down
11 changes: 1 addition & 10 deletions src/core/Akka.TestKit/EventFilter/TestEventListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,7 @@ protected override bool Receive(object message)
case DeadLetter letter:
HandleDeadLetter(letter);
break;

case UnhandledMessage un:
{
var rcp = un.Recipient;
var info = new Info(rcp.Path.ToString(), rcp.GetType(), "Unhandled message from " + un.Sender + ": " + un.Message);
if (!ShouldFilter(info))
Print(info);
break;
}


default:
Print(new Debug(Context.System.Name,GetType(),message));
break;
Expand Down