Skip to content

Commit

Permalink
close akkadotnet#2442 - verified that RegisterOnMemberUp still fires …
Browse files Browse the repository at this point in the history
…if the node is already up
  • Loading branch information
Aaronontheweb committed Jan 12, 2017
1 parent b694886 commit 4bd8d63
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/core/Akka.Cluster.Tests/ClusterSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,28 @@ public void A_cluster_must_publish_member_removed_when_shutdown()
callbackProbe.ExpectMsg("OnMemberRemoved");
}

/// <summary>
/// https://github.com/akkadotnet/akka.net/issues/2442
/// </summary>
[Fact]
public void BugFix_2442_RegisterOnMemberUp_should_fire_if_node_already_up()
{
// TODO: this should be removed
_cluster.Join(_selfAddress);
LeaderActions(); // Joining -> Up

// Member should already be up
_cluster.Subscribe(TestActor, ClusterEvent.InitialStateAsEvents, new[] { typeof(ClusterEvent.IMemberEvent) });
ExpectMsg<ClusterEvent.MemberUp>();

var callbackProbe = CreateTestProbe();
_cluster.RegisterOnMemberUp(() =>
{
callbackProbe.Tell("RegisterOnMemberUp");
});
callbackProbe.ExpectMsg("RegisterOnMemberUp");
}

[Fact]
public void A_cluster_must_complete_LeaveAsync_task_upon_being_removed()
{
Expand Down

0 comments on commit 4bd8d63

Please sign in to comment.