Skip to content

Commit

Permalink
Akka.Cluster.Sharding: added tests for DData consistency settings (#7288
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Aaronontheweb authored Jul 22, 2024
1 parent 5176dfb commit 4b7cff3
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Akka.Configuration;
using Akka.TestKit;
using Xunit;
using FluentAssertions;

namespace Akka.Cluster.Sharding.Tests
{
Expand All @@ -30,6 +31,8 @@ public void Should_cluster_sharding_settings_have_default_config()
ClusterSharding.Get(Sys);
var config = Sys.Settings.Config.GetConfig("akka.cluster.sharding");

var clusterShardingSettings = ClusterShardingSettings.Create(Sys);

Assert.False(config.IsNullOrEmpty());
Assert.Equal("sharding", config.GetString("guardian-name"));
Assert.Equal(string.Empty, config.GetString("role"));
Expand Down Expand Up @@ -64,6 +67,12 @@ public void Should_cluster_sharding_settings_have_default_config()
Assert.Equal(string.Empty, singletonConfig.GetString("role"));
Assert.Equal(TimeSpan.FromSeconds(1), singletonConfig.GetTimeSpan("hand-over-retry-interval"));
Assert.Equal(15, singletonConfig.GetInt("min-number-of-hand-over-retries"));

// DData settings
var minCap = config.GetInt("distributed-data.majority-min-cap");
minCap.Should().Be(5);
clusterShardingSettings.TuningParameters.CoordinatorStateReadMajorityPlus.Should().Be(5);
clusterShardingSettings.TuningParameters.CoordinatorStateWriteMajorityPlus.Should().Be(3);
}
}
}

0 comments on commit 4b7cff3

Please sign in to comment.