These are chat archives for akkadotnet/akka.net

19th
Jun 2016
Sergey Kostrukov
@kostrse
Jun 19 2016 07:15
Guys, are two IActorRef pointing to the same actor are always will be equal to each other? I see that IActorRef is IEquatable<IActorRef>
Bartosz Sypytkowski
@Horusiath
Jun 19 2016 07:47
@kostrse yes, they are always equal
Sergey Kostrukov
@kostrse
Jun 19 2016 07:48
Thanks! How is it enforced? Comparison of UID?
Bartosz Sypytkowski
@Horusiath
Jun 19 2016 07:49
comparison of UIDs and ActorPaths
Sergey Kostrukov
@kostrse
Jun 19 2016 07:49
Great, thanks
Bartosz Sypytkowski
@Horusiath
Jun 19 2016 07:50
no problem ;)
qwoz
@qwoz
Jun 19 2016 18:30
Getting an exception testing an actor setup as a pool. Exception is:
Akka.Configuration.ConfigurationException : Configuration problem while creating [akka://test/user/mypool] with router dispatcher
 [akka.actor.default-dispatcher] and mailbox  and routee dispatcher [akka.actor.default-dispatcher] and mailbox [].
Note that the first mailbox reference is blank. My config looks like:
              deployment {
                /mypool {
                  router = smallest-mailbox-pool
                  nr-of-instances = 10
                }
              }

I'm creating the actor via:

sys.ActorOf(Props.Create<MyActor>().WithRouter(FromConfig.Instance), "mypool");

This works in production, but dies when testing under NUnit

qwoz
@qwoz
Jun 19 2016 18:36
Everything works fine if I remove .WithRouter(FromConfig.instance). I've also tried adding mailbox = unbounded-mailbox to the /mypool hocon settings, but that doesn't work.
Interestingly, changing this to .WithRouter(new SmallestMailboxPool(10)) works. So what's the trick to having it pull the settings from the config?
Vagif Abilov
@object
Jun 19 2016 18:44
@qwoz this usually happens when there's a problem with a config settings, for example, config section is put in a wrong place.
qwoz
@qwoz
Jun 19 2016 18:47
thanks, I'll try to simplify this
qwoz
@qwoz
Jun 19 2016 19:04
I think there's definitely something going on. I made the simplest console app I could. My actor works fine using .WithRouter(FromConfig.Instance) when created from Main. When created in a test the same way, I get the config exception.
Vagif Abilov
@object
Jun 19 2016 19:29
Then the test is not reading that config.
qwoz
@qwoz
Jun 19 2016 19:32
Maybe something obvious? https://github.com/qwoz/SimpleActorTest
qwoz
@qwoz
Jun 19 2016 19:50
I had thought tests would also use my app.config file, but when debugging this it's using a default config that's specific for testing. Looks like I need to override the TestFixture constructor if I want it to be config-driven.
Vagif Abilov
@object
Jun 19 2016 19:58
Strange, we're using such configs in our integration tests without problems.
qwoz
@qwoz
Jun 19 2016 20:04
your tests use an app.config file without problem?
Vagif Abilov
@object
Jun 19 2016 20:09
NUnit test runner loads tests in a new AppDomain that uses settings from app.config.
Arjen Smits
@Danthar
Jun 19 2016 20:14
@qwoz the testkit loads it own config. It does not look at whats in the app.config
qwoz
@qwoz
Jun 19 2016 20:16
@Danthar ok, so the only way to do this is to specify : base(@" ...config... ") for each [TestFixture]?
Arjen Smits
@Danthar
Jun 19 2016 20:17
I think so. Im looking for an example
but cant find one offhand
qwoz
@qwoz
Jun 19 2016 20:18
No problem. I'll make do with that.
for an example
qwoz
@qwoz
Jun 19 2016 20:22
:plus1:
Vagif Abilov
@object
Jun 19 2016 20:23
Oh I see, you're using TestKit. That makes the difference. Our integration tests don't use it.