private void AwaitMemberUp(TestProbe memberProbe, params RoleName[] nodes) { if (nodes.Length > 1) { RunOn(() => { memberProbe.ExpectMsg<ClusterEvent.MemberUp>(TimeSpan.FromSeconds(15)).Member.Address .Should() .Be(GetAddress(nodes.First())); }, nodes.Skip(1).ToArray()); } RunOn(() => { var roleNodes = nodes.Select(node => GetAddress(node)); var addresses = memberProbe.ReceiveN(nodes.Length, TimeSpan.FromSeconds(15)) .Where(x => x is ClusterEvent.MemberUp) .Select(x => (x as ClusterEvent.MemberUp).Member.Address); addresses.Except(roleNodes).Count().Should().Be(0); }, nodes.First()); EnterBarrier(nodes.First().Name + "-up"); }
private void AwaitMemberUp(TestProbe memberProbe, params RoleName[] nodes) { RunOn(() => { Assert.Equal(Node(nodes[0]).Address, memberProbe.ExpectMsg<ClusterEvent.MemberUp>(TimeSpan.FromSeconds(15)).Member.Address); }, nodes.Skip(1).ToArray()); RunOn(() => { var membersUp = memberProbe.ReceiveN(nodes.Length, TimeSpan.FromSeconds(15)) .Where(x => x is ClusterEvent.MemberUp) .Select(x => (x as ClusterEvent.MemberUp).Member.Address) .Distinct() .ToArray(); Assert.True(nodes.Select(x => Node(x).Address).ToArray().All(x => membersUp.Contains(x))); }, nodes[0]); EnterBarrier(nodes[0].Name + "-up"); }