These are chat archives for akkadotnet/akka.net

14th
Feb 2017
Daniel Söderberg
@raskolnikoov
Feb 14 2017 12:39
Hi all, when writing test with TestKit, is it possible to test that a actor receives a certain message?
Maxim Cherednik
@maxcherednik
Feb 14 2017 12:40
hi, sure you can
Daniel Söderberg
@raskolnikoov
Feb 14 2017 12:40
example?
@maxcherednik
Daniel Söderberg
@raskolnikoov
Feb 14 2017 12:42
yes, I forgot to tell, my actor is a AtLeastOnceReciveActor (persistence)
maybe thats the problem in there
Maxim Cherednik
@maxcherednik
Feb 14 2017 12:43
so ok. which part is not exactly working?
Daniel Söderberg
@raskolnikoov
Feb 14 2017 12:44
I tell my actor and that actor starts another actor that does some magic and tells my actor the result. the result message is what I want to test
but it dosent get it in my TestKit void...
Maxim Cherednik
@maxcherednik
Feb 14 2017 12:46
basically what you are testing is simple request response, hence the very first example from that blog should work...
another thing - when you actually hit the storage - it's not exactly a unit test
how about you replace all the storage actors and try it again ?
cause from what you describe - it should work
if you do everything else right, the only reason to fail is wrong persistence configuration
Daniel Söderberg
@raskolnikoov
Feb 14 2017 12:51
no it dosent work.. :(
tried to do it with a simple A and B actor test... I called my A actor that calls B actor and returns to A actor... the return message to my A actor dosent every occur in my ExpectMsg
:/
I want to catch the Recive<MyMessage>
Maxim Cherednik
@maxcherednik
Feb 14 2017 12:54
hm...
Daniel Söderberg
@raskolnikoov
Feb 14 2017 12:54
im trying to test a actor that never returns a message
I just want to check that it gets a certain message
Maxim Cherednik
@maxcherednik
Feb 14 2017 12:54
then there is something wrong in general
what about the very simple scenario ?
Daniel Söderberg
@raskolnikoov
Feb 14 2017 12:55
that dosent work
Maxim Cherednik
@maxcherednik
Feb 14 2017 12:55
like one actor - you send ping, it responds pong and you expect this pong on the test actor ?
Daniel Söderberg
@raskolnikoov
Feb 14 2017 12:56
let me upload an example
how can I test this example with valid result :)
Maxim Cherednik
@maxcherednik
Feb 14 2017 13:14
ok, like I thought it's not that simple then

so when you are here:

Receive<MessageFromB>(msg =>
{
//test if this happends in here!
});

you don't send it back to the original caller, right ?
Daniel Söderberg
@raskolnikoov
Feb 14 2017 13:21
no that's the end
so I would like to check that this end occurs
Maxim Cherednik
@maxcherednik
Feb 14 2017 13:23
in this case you can't test this
Daniel Söderberg
@raskolnikoov
Feb 14 2017 13:23
daaaaaaaaam
:P
that's something you want tested :)
Maxim Cherednik
@maxcherednik
Feb 14 2017 13:24
from the same article I sent
"How do I test a parent/child relationship?"
check it
actually it's not exactly this...
nevermind
I think you should test something else
give me a sec
Daniel Söderberg
@raskolnikoov
Feb 14 2017 13:26
hehe and get a cup of coffee :)
brbr!
Daniel Söderberg
@raskolnikoov
Feb 14 2017 13:32
back @maxcherednik
Maxim Cherednik
@maxcherednik
Feb 14 2017 13:35
have a look at this guy
in there I have a similar situation
I've got this main actor: WidgetManagerActor
and when it starts it sends a message to itself, which does some complicated logic of sending messages to someone else and having responses back
I am not sure if it's easy to comprehend
check this one for instance: WhenWidgetConfigurationProviderFailsShouldRetry
or this one: InitWidgetManagerActorWithSeveralWidgets
Maxim Cherednik
@maxcherednik
Feb 14 2017 13:40
so the idea is that you send a message to the child actor and you should be prepared that it will never reply....
in this case you need to have backup logic of retry...
do you follow? :)
Daniel Söderberg
@raskolnikoov
Feb 14 2017 13:41
yes I follow
Maxim Cherednik
@maxcherednik
Feb 14 2017 13:43
for instance in my WidgetManagerActor I am injecting the actor, so it's not exactly a child.... but I need it this way.... in you case you can have a Props param from the constructor....
in the prod code - you set the real child actor's props, in the test code you have a props of the TestProbe
Daniel Söderberg
@raskolnikoov
Feb 14 2017 13:44
yes.. but I will have to rewrite my test case for this. Thanks for the help! :)
Maxim Cherednik
@maxcherednik
Feb 14 2017 13:45
you will probably need to rewrite lots of things :)
but anyhow... try it... other than this, I don't know how to handle this
Daniel Söderberg
@raskolnikoov
Feb 14 2017 13:46
I talked to Roger Johansson about this now and he answered that it's not possible to do my test case.
Maxim Cherednik
@maxcherednik
Feb 14 2017 13:46
yeah - like you described - not possible...
Aaron Stannard
@Aaronontheweb
Feb 14 2017 18:39
@Rattenkrieg I haven't seen any examples of this being needed in practice
but with your changes to the MNTR in #2502
is it still possible to give one node amongst the others in the spec its own configuration?
I.E. if I wanted to run a test that gave one node a different configuration from the others?
I kind of think this is YAGNI to some extent, but still - that's a capability we had before that I would like to preserve in some capacity
in case you missed it, YAGNI
Aaron Stannard
@Aaronontheweb
Feb 14 2017 19:04
ah nice
do you mention how to do that on the documentation PR you sent in|?
(haven't looked at it yet)
Sergey Prytkov
@Rattenkrieg
Feb 14 2017 19:04
Nope, but this part isn't one that was affected by my changes
Aaron Stannard
@Aaronontheweb
Feb 14 2017 19:05
cool, good to know
Sergey Prytkov
@Rattenkrieg
Feb 14 2017 19:05
Feel free to ask to add any part to docs
Aaron Stannard
@Aaronontheweb
Feb 14 2017 19:05
could you add a section on configuring individual nodes?
as part of the section where you define a MultiNodeConfig?
doesn't need to be much, just a small example would be great
the PR was great btw, definitely like the look of the logs much more now
Sergey Prytkov
@Rattenkrieg
Feb 14 2017 19:06
Thanks!
NodeConfig(new List<RoleName> { First }, new List<Config> { ConfigurationFactory.ParseString("akka.cluster.roles =[frontend]") });
could you add a section on configuring individual nodes?
Aaron Stannard
@Aaronontheweb
Feb 14 2017 19:07
yep, that would be great
something like that
Sergey Prytkov
@Rattenkrieg
Feb 14 2017 19:08
Ok got it
Will do after lunch ;)
David Rivera
@mithril52
Feb 14 2017 19:10
I seem to be having some issues with Akka and its use of System.Collections.Immutable. If I use 1.2.0 version of Immutable, when I go to create my actor system with a provided config object, it throws an exception saying it cannot find Immutable 1.1.36. Then if I change the Immutable version to 1.1.36, it says it can't find version 1.2.0 of Immutable. Has anyone else come across an issue like this?
Aaron Stannard
@Aaronontheweb
Feb 14 2017 19:11
@mithril52 which modules are you using?
all of the shipped Akka.NET modules depend on 1.1.36
David Rivera
@mithril52
Feb 14 2017 19:12
Cluster, DI.Core, DI.Ninject, Logger.Serilog, Remote, Testkit, TestKit.XUnit
All 1.1.3
Well, exc ept Serilog. Its at 1.12
1.1.2
Aaron Stannard
@Aaronontheweb
Feb 14 2017 19:13
although we're looking at upgrading to the latest here: akkadotnet/akka.net#2509
IMHO, check to see if you have a binding redirect defined in App.config
when you're using 1.1.36
and delete it if it's there
David Rivera
@mithril52
Feb 14 2017 19:14
Hmm, ok
Aaron Stannard
@Aaronontheweb
Feb 14 2017 19:14
could have been added when you upgraded to 1.2
David Rivera
@mithril52
Feb 14 2017 19:14
But I should be using 1.136?
Aaron Stannard
@Aaronontheweb
Feb 14 2017 19:14
yep
that's what we support today
David Rivera
@mithril52
Feb 14 2017 19:14
Okay
Yup, loosk like thats it. It added rebindings to every project
David Rivera
@mithril52
Feb 14 2017 19:24
Thanks Aaron, that fixed it. I hate it when I'm too deep into an issue to see the issue staring me in the face :)
Aaron Stannard
@Aaronontheweb
Feb 14 2017 19:25
you're welcome man
some words of advice
it's almost always something stupid
when it comes to mystifying issues like that
David Rivera
@mithril52
Feb 14 2017 19:25
Yup, it almost always is :)
Aaron Stannard
@Aaronontheweb
Feb 14 2017 19:26
I can't tell you the number of times I've destroyed a build queue because something snuck a dependency into my .CSPROJ that wasn't supported by the build server
personal favorite was causing the server to explode because a user submitted a powershell script that contained some German characters
David Rivera
@mithril52
Feb 14 2017 19:28
Heh, ouch
Aaron Stannard
@Aaronontheweb
Feb 14 2017 19:28
(on an internal project)
Marc Piechura
@marcpiechura
Feb 14 2017 19:34
Ößäü 😜
Aaron Stannard
@Aaronontheweb
Feb 14 2017 19:36
:fire: :fire: :fire:
fire burning fire burning on the buiiiiiiiiiiiiiiiild server
saxophone solo
David Rivera
@mithril52
Feb 14 2017 19:36
The magic smoke is getting out!
Aaron Stannard
@Aaronontheweb
Feb 14 2017 19:37
I told you not to use unicoooooooooooooooooooode
Sergey Prytkov
@Rattenkrieg
Feb 14 2017 20:08
@Aaronontheweb it seems I've encountered wrongly constructed spec while being looking for example for docs
If these nodes supposed to gain separate gating duration each like First - 1d; Second - 1s then there should be two distinc NodeConfig calls per each role
Aaron Stannard
@Aaronontheweb
Feb 14 2017 20:09
ah
mind submitting a PR to fix that?
yeah, that'd be wrong then
Sergey Prytkov
@Rattenkrieg
Feb 14 2017 20:10
I'm going to pay tech debt regarding our discussion about obsolete regexp in #2502
So I can carry it too
But surprisingly this spec is passing all this time lol