Skip to content

Akka.Hosting.TestKit: TestActor is no longer the implicit sender #237

Open
@Aaronontheweb

Description

Version Information
Version of Akka.NET? 1.0.3
Which Akka.NET Modules? Akka.Hosting.TestKit

Describe the bug

 foreach (var i in Enumerable.Range(0, 2))
        {
            var update1 = Dsl.Update(CounterKey, GCounter.Empty, WriteLocal.Instance,
                g => g.Increment(selfAddress));
            replicator.Tell(update1);
            UpdateSuccess success1 = ExpectMsg<UpdateSuccess>();
        }

Fails and UpdateSuccess is a DeadLetter - this is because ActorRefs.NoSender is the sender.

Expected behavior

TestActor should be the implicit sender, just like in the normal testkit.

Actual behavior

There is no implicit sender.

Workaround

Can explicitly specify the TestActor as the sender.

 foreach (var i in Enumerable.Range(0, 2))
        {
            var update1 = Dsl.Update(CounterKey, GCounter.Empty, WriteLocal.Instance,
                g => g.Increment(selfAddress));
            replicator.Tell(update1, TestActor);
            UpdateSuccess success1 = ExpectMsg<UpdateSuccess>();
        }

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtestkitAkka.Hosting.TestKit fixes and issues.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions