forked from akkadotnet/akka.net
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix serialize-messages for Akka.Cluster and Akka.Remote (akkadotnet#3725
) close akkadotnet#3724 - provided JSON constructor for Member disabled serialization verification for internal `PublishChanges`
- Loading branch information
1 parent
53ca61f
commit b98eeb3
Showing
3 changed files
with
116 additions
and
43 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
src/core/Akka.Cluster.Tests/Serialization/BugFix3724Spec.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
//----------------------------------------------------------------------- | ||
// <copyright file="BugFix3724Spec.cs" company="Akka.NET Project"> | ||
// Copyright (C) 2009-2019 Lightbend Inc. <http://www.lightbend.com> | ||
// Copyright (C) 2013-2019 .NET Foundation <https://github.com/akkadotnet/akka.net> | ||
// </copyright> | ||
//----------------------------------------------------------------------- | ||
|
||
using System; | ||
using Akka.Actor; | ||
using Akka.TestKit; | ||
using Akka.Util.Internal; | ||
using FluentAssertions; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace Akka.Cluster.Tests.Serialization | ||
{ | ||
/// <summary> | ||
/// https://github.com/akkadotnet/akka.net/issues/3724 | ||
/// Used to validate that `akka.actor.serialize-messages = on` works while | ||
/// using Akka.Cluster | ||
/// </summary> | ||
public class BugFix3724Spec : AkkaSpec | ||
{ | ||
public BugFix3724Spec(ITestOutputHelper helper) | ||
: base(@"akka.actor.provider = cluster | ||
akka.actor.serialize-messages = on", helper) | ||
{ | ||
_cluster = Cluster.Get(Sys); | ||
_selfAddress = Sys.AsInstanceOf<ExtendedActorSystem>().Provider.DefaultAddress; | ||
} | ||
|
||
private readonly Address _selfAddress; | ||
private readonly Cluster _cluster; | ||
|
||
[Fact(DisplayName = "Should be able to use 'akka.actor.serialize-messages' while running Akka.Cluster")] | ||
public void Should_serialize_all_AkkaCluster_messages() | ||
{ | ||
_cluster.Subscribe(TestActor, ClusterEvent.SubscriptionInitialStateMode.InitialStateAsEvents, | ||
typeof(ClusterEvent.MemberUp)); | ||
Within(TimeSpan.FromSeconds(10), () => | ||
{ | ||
EventFilter.Exception<Exception>().Expect(0, () => | ||
{ | ||
// wait for a singleton cluster to fully form and publish a member up event | ||
_cluster.Join(_selfAddress); | ||
var up = ExpectMsg<ClusterEvent.MemberUp>(); | ||
up.Member.Address.Should().Be(_selfAddress); | ||
}); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters