public void ClusterSharding_should_failover_shards_on_crashed_node()
{
ClusterSharding_should_support_proxy_only_mode();
Within(TimeSpan.FromSeconds(30), () =>
{
// mute logging of deadLetters during shutdown of systems
if (!Log.IsDebugEnabled) Sys.EventStream.Publish(new Mute(new DeadLettersFilter(new PredicateMatcher(x => true), new PredicateMatcher(x => true))));
EnterBarrier("logs-muted");
RunOn(() =>
{
TestConductor.Exit(_second, 0).Wait();
}, _controller);
EnterBarrier("crash-second");
RunOn(() =>
{
var probe1 = CreateTestProbe();
AwaitAssert(() =>
{
Within(TimeSpan.FromSeconds(1), () =>
{
var r = _region.Value;
r.Tell(new Counter.Get(2), probe1.Ref);
probe1.ExpectMsg(4);
Assert.Equal(r.Path / "2" / "2", probe1.LastSender.Path);
});
});
var probe2 = CreateTestProbe();
AwaitAssert(() =>
{
Within(TimeSpan.FromSeconds(1), () =>
{
var r = _region.Value;
r.Tell(new Counter.Get(12), probe2.Ref);
probe2.ExpectMsg(1);
Assert.Equal(r.Path / "0" / "12", probe2.LastSender.Path);
});
});
}, _first);
EnterBarrier("after-6");
});
}