From c7e0a9f1afcbc4f98785a313236e6d0e8581c239 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Mon, 19 Sep 2016 16:22:00 -0700 Subject: [PATCH 1/2] fixed folder output paths of individual server logs made barrier failures more explicit hardened singleton manager startup spec --- .../Singleton/ClusterSingletonManagerStartupSpec.cs | 1 + src/core/Akka.MultiNodeTestRunner/Program.cs | 2 +- src/core/Akka.Remote.TestKit/BarrierCoordinator.cs | 2 +- src/core/Akka.Remote.TestKit/Extension.cs | 3 +++ src/core/Akka.Remote.TestKit/Player.cs | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/contrib/cluster/Akka.Cluster.Tools.Tests.MultiNode/Singleton/ClusterSingletonManagerStartupSpec.cs b/src/contrib/cluster/Akka.Cluster.Tools.Tests.MultiNode/Singleton/ClusterSingletonManagerStartupSpec.cs index 8ca36e1eaed..4bcbbc8a1f1 100644 --- a/src/contrib/cluster/Akka.Cluster.Tools.Tests.MultiNode/Singleton/ClusterSingletonManagerStartupSpec.cs +++ b/src/contrib/cluster/Akka.Cluster.Tools.Tests.MultiNode/Singleton/ClusterSingletonManagerStartupSpec.cs @@ -31,6 +31,7 @@ public ClusterSingletonManagerStartupConfig() CommonConfig = ConfigurationFactory.ParseString(@" akka.loglevel = INFO akka.actor.provider = ""Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"" + akka.remote.retry-gate-closed-for = 1s #fast restart akka.remote.log-remote-lifecycle-events = off akka.cluster.auto-down-unreachable-after = 0s") .WithFallback(ClusterSingletonManager.DefaultConfig()) diff --git a/src/core/Akka.MultiNodeTestRunner/Program.cs b/src/core/Akka.MultiNodeTestRunner/Program.cs index 4ed3b4efe9e..b66e3924a35 100644 --- a/src/core/Akka.MultiNodeTestRunner/Program.cs +++ b/src/core/Akka.MultiNodeTestRunner/Program.cs @@ -156,7 +156,7 @@ static void Main(string[] args) } -Dmultinode.listen-address={listenAddress} -Dmultinode.listen-port={listenPort}"; var nodeIndex = nodeTest.Node; //TODO: might need to do some validation here to avoid the 260 character max path error on Windows - var folder = Directory.CreateDirectory(Path.Combine(OutputDirectory, nodeTest.MethodName)); + var folder = Directory.CreateDirectory(Path.Combine(OutputDirectory, nodeTest.TestName)); var logFilePath = Path.Combine(folder.FullName, "node" + nodeIndex + ".txt"); var fileActor = TestRunSystem.ActorOf(Props.Create(() => new FileSystemAppenderActor(logFilePath))); diff --git a/src/core/Akka.Remote.TestKit/BarrierCoordinator.cs b/src/core/Akka.Remote.TestKit/BarrierCoordinator.cs index 444c87922b6..8c8b81d8b86 100644 --- a/src/core/Akka.Remote.TestKit/BarrierCoordinator.cs +++ b/src/core/Akka.Remote.TestKit/BarrierCoordinator.cs @@ -244,7 +244,7 @@ public override int GetHashCode() public sealed class WrongBarrierException : Exception { public WrongBarrierException(string barrier, IActorRef client, Data barrierData) - : base($"tried to enter '{barrier}' while we were waiting for '{barrierData.Barrier}'") + : base($"[{client}] tried to enter '{barrier}' while we were waiting for '{barrierData.Barrier}'") { BarrierData = barrierData; Client = client; diff --git a/src/core/Akka.Remote.TestKit/Extension.cs b/src/core/Akka.Remote.TestKit/Extension.cs index edf04f07f09..e46fa135603 100644 --- a/src/core/Akka.Remote.TestKit/Extension.cs +++ b/src/core/Akka.Remote.TestKit/Extension.cs @@ -82,6 +82,9 @@ public TestConductor(ActorSystem system) } } + /// + /// Settings used to operate the . + /// public class TestConductorSettings { readonly TimeSpan _connectTimeout; diff --git a/src/core/Akka.Remote.TestKit/Player.cs b/src/core/Akka.Remote.TestKit/Player.cs index 5b7c7f69907..118b9882ea6 100644 --- a/src/core/Akka.Remote.TestKit/Player.cs +++ b/src/core/Akka.Remote.TestKit/Player.cs @@ -136,7 +136,7 @@ public void Enter(TimeSpan timeout, ImmutableList names) var askTimeout = barrierTimeout + Settings.QueryTimeout; // Need to force barrier to wait here, so we can pass along a "fail barrier" message in the event // of a failed operation - _client.Ask(new ToServer(new EnterBarrier(name, barrierTimeout)), askTimeout).Wait(); + var result = _client.Ask(new ToServer(new EnterBarrier(name, barrierTimeout)), askTimeout).Result; } catch (AggregateException) { From 21100e05c7b00961cacc8b4f228359753849781a Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Mon, 19 Sep 2016 19:21:25 -0700 Subject: [PATCH 2/2] added missing barrier on ClusterClientSpec --- .../ClusterClient/ClusterClientSpec.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/contrib/cluster/Akka.Cluster.Tools.Tests.MultiNode/ClusterClient/ClusterClientSpec.cs b/src/contrib/cluster/Akka.Cluster.Tools.Tests.MultiNode/ClusterClient/ClusterClientSpec.cs index 635284aafcb..d78b90d173e 100644 --- a/src/contrib/cluster/Akka.Cluster.Tools.Tests.MultiNode/ClusterClient/ClusterClientSpec.cs +++ b/src/contrib/cluster/Akka.Cluster.Tools.Tests.MultiNode/ClusterClient/ClusterClientSpec.cs @@ -503,6 +503,7 @@ public void ClusterClient_must_reestablish_connection_to_another_receptionist_wh if (msg.Equals("hi again")) return msg; else throw new Exception("Unexpected message: " + msg); }); + EnterBarrier("verified-4"); RunOn(() => {