-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Don't add MemberExited as unreachable in SBR, (migrated from akka/akka#29988) * Makes the SBR lease name configurable (migrated from akka/akka#30049) * api approval
- Loading branch information
Showing
7 changed files
with
107 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using Akka.Cluster.Configuration; | ||
using Akka.Cluster.SBR; | ||
using Akka.Configuration; | ||
using Akka.TestKit; | ||
using FluentAssertions; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace Akka.Cluster.Tests.SBR | ||
{ | ||
public class LeaseMajoritySpec : AkkaSpec | ||
{ | ||
private readonly Config _default; | ||
private readonly Config _blank; | ||
private readonly Config _named; | ||
|
||
public LeaseMajoritySpec(ITestOutputHelper output) | ||
: base(output) | ||
{ | ||
_default = ConfigurationFactory.ParseString(@" | ||
akka.cluster.split-brain-resolver.lease-majority.lease-implementation = ""akka.coordination.lease.kubernetes"" | ||
") | ||
.WithFallback(ClusterConfigFactory.Default()); | ||
|
||
_blank = ConfigurationFactory.ParseString(@" | ||
akka.cluster.split-brain-resolver.lease-majority { | ||
lease-name = "" "" | ||
}").WithFallback(_default); | ||
|
||
_named = ConfigurationFactory.ParseString(@" | ||
akka.cluster.split-brain-resolver.lease-majority { | ||
lease-name = ""shopping-cart-akka-sbr"" | ||
}").WithFallback(_default); | ||
} | ||
|
||
[Fact] | ||
public void Split_Brain_Resolver_Lease_Majority_provider_must_read_the_configured_name() | ||
{ | ||
new SplitBrainResolverSettings(_default).LeaseMajoritySettings.LeaseName.Should().BeNull(); | ||
new SplitBrainResolverSettings(_blank).LeaseMajoritySettings.LeaseName.Should().BeNull(); | ||
new SplitBrainResolverSettings(_named).LeaseMajoritySettings.LeaseName.Should().Be("shopping-cart-akka-sbr"); | ||
} | ||
|
||
[Fact] | ||
public void Split_Brain_Resolver_Lease_Majority_provider_must_use_a_safe_name() | ||
{ | ||
new SplitBrainResolverSettings(_default).LeaseMajoritySettings.SafeLeaseName("sysName").Should().Be("sysName-akka-sbr"); | ||
new SplitBrainResolverSettings(_blank).LeaseMajoritySettings.SafeLeaseName("sysName").Should().Be("sysName-akka-sbr"); | ||
new SplitBrainResolverSettings(_named).LeaseMajoritySettings.SafeLeaseName("sysName").Should().Be("shopping-cart-akka-sbr"); | ||
} | ||
} | ||
} |
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
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
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