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

Remove test actor deadletter logging #5662

Merged
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
67 changes: 21 additions & 46 deletions src/core/Akka.TestKit/Internal/InternalTestActor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,41 +52,30 @@ protected override bool Receive(object message)
throw;
}

var setIgnore = message as TestKit.TestActor.SetIgnore;
if(setIgnore != null)
switch (message)
{
_ignore = setIgnore.Ignore;
return true;
}
var watch = message as TestKit.TestActor.Watch;
if(watch != null)
{
Context.Watch(watch.Actor);
return true;
}
var unwatch = message as TestKit.TestActor.Unwatch;
if(unwatch != null)
{
Context.Unwatch(unwatch.Actor);
return true;
}
var setAutoPilot = message as TestKit.TestActor.SetAutoPilot;
if(setAutoPilot != null)
{
_autoPilot = setAutoPilot.AutoPilot;
return true;
}

var spawn = message as TestKit.TestActor.Spawn;
if (spawn != null)
{
var actor = spawn.Apply(Context);
if (spawn._supervisorStrategy.HasValue)
case TestActor.SetIgnore setIgnore:
_ignore = setIgnore.Ignore;
return true;
case TestActor.Watch watch:
Context.Watch(watch.Actor);
return true;
case TestActor.Unwatch unwatch:
Context.Unwatch(unwatch.Actor);
return true;
case TestActor.SetAutoPilot setAutoPilot:
_autoPilot = setAutoPilot.AutoPilot;
return true;
case TestActor.Spawn spawn:
{
_supervisorStrategy.Update(actor, spawn._supervisorStrategy.Value);
var actor = spawn.Apply(Context);
if (spawn._supervisorStrategy.HasValue)
{
_supervisorStrategy.Update(actor, spawn._supervisorStrategy.Value);
}
_queue.Enqueue(new RealMessageEnvelope(actor, Self));
return true;
}
_queue.Enqueue(new RealMessageEnvelope(actor, Self));
return true;
}

var actorRef = Sender;
Expand All @@ -100,19 +89,5 @@ protected override bool Receive(object message)
_queue.Enqueue(new RealMessageEnvelope(message, actorRef));
return true;
}

/// <summary>
/// TBD
/// </summary>
protected override void PostStop()
{
var self = Self;
foreach(var messageEnvelope in _queue.ToList())
{
var messageSender = messageEnvelope.Sender;
var message = messageEnvelope.Message;
Context.System.DeadLetters.Tell(new DeadLetter(message, messageSender, self), messageSender);
}
}
}
}