Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed folder output, barrier spec failure handling issues in MNTR #2297

Merged
merged 2 commits into from
Sep 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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(() =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardening the ClusterSingletonManagerStartupSpec - in the event two nodes try to connect to eachother at the same time (happens sometimes during Akka.Cluster formation) this lowers the retry gate from 5s to 1s so the spec has an opportunity to retry the association before hitting the deadline.

akka.remote.log-remote-lifecycle-events = off
akka.cluster.auto-down-unreachable-after = 0s")
.WithFallback(ClusterSingletonManager.DefaultConfig())
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.MultiNodeTestRunner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uses the correct test name for the folders used for each of the individual node logs -this prevents two implementations of the same spec from overriding eachother's output.

var logFilePath = Path.Combine(folder.FullName, "node" + nodeIndex + ".txt");
var fileActor =
TestRunSystem.ActorOf(Props.Create(() => new FileSystemAppenderActor(logFilePath)));
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Remote.TestKit/BarrierCoordinator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}'")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clearer barrier exception error message.

{
BarrierData = barrierData;
Client = client;
Expand Down
3 changes: 3 additions & 0 deletions src/core/Akka.Remote.TestKit/Extension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ public TestConductor(ActorSystem system)
}
}

/// <summary>
/// Settings used to operate the <see cref="TestConductor"/>.
/// </summary>
public class TestConductorSettings
{
readonly TimeSpan _connectTimeout;
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Remote.TestKit/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void Enter(TimeSpan timeout, ImmutableList<string> 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<EnterBarrier>(new EnterBarrier(name, barrierTimeout)), askTimeout).Wait();
var result = _client.Ask(new ToServer<EnterBarrier>(new EnterBarrier(name, barrierTimeout)), askTimeout).Result;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've had false positives in the MNTR previously where specs were still passing even though barriers were failing. This change ensures that an exception is thrown instead, failing the spec for this node if a barrier operation fails.

}
catch (AggregateException)
{
Expand Down