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

added timestamp to node failures in MNTR #4911

Merged
Merged
Changes from 1 commit
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
Next Next commit
added timestamp to node failures in MNTR
  • Loading branch information
Aaronontheweb committed Apr 6, 2021
commit 4ca04157be9d9c84554dae610a8525aca80c81fb
11 changes: 7 additions & 4 deletions src/core/Akka.MultiNodeTestRunner.Shared/Sinks/Spec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,32 @@ public SpecFail(int nodeIndex, string nodeRole, string testDisplayName) : base(n
FailureMessages = new List<string>();
FailureStackTraces = new List<string>();
FailureExceptionTypes = new List<string>();
Timestamp = DateTime.UtcNow;
}

public IList<string> FailureMessages { get; private set; }
public IList<string> FailureStackTraces { get; private set; }
public IList<string> FailureExceptionTypes { get; private set; }

public DateTime Timestamp { get; }

public override string ToString()
{
var sb = new StringBuilder();
sb.AppendLine(string.Format("[Node{0}:{1}][FAIL] {2}", NodeIndex, NodeRole, TestDisplayName));
sb.AppendLine($"[Node{NodeIndex}:{NodeRole}][{Timestamp}][FAIL] {TestDisplayName}");
foreach (var exception in FailureExceptionTypes)
{
sb.AppendFormat("[Node{0}:{1}][FAIL-EXCEPTION] Type: {2}", NodeIndex, NodeRole, exception);
sb.Append($"[Node{NodeIndex}:{NodeRole}][{Timestamp}][FAIL-EXCEPTION] Type: {exception}");
sb.AppendLine();
}
foreach (var exception in FailureMessages)
{
sb.AppendFormat("--> [Node{0}:{1}][FAIL-EXCEPTION] Message: {2}", NodeIndex, NodeRole, exception);
sb.Append($"--> [Node{NodeIndex}:{NodeRole}][{Timestamp}][FAIL-EXCEPTION] Message: {exception}");
sb.AppendLine();
}
foreach (var exception in FailureStackTraces)
{
sb.AppendFormat("--> [Node{0}:{1}][FAIL-EXCEPTION] StackTrace: {2}", NodeIndex, NodeRole, exception);
sb.Append($"--> [Node{NodeIndex}:{NodeRole}][{Timestamp}][FAIL-EXCEPTION] StackTrace: {exception}");
sb.AppendLine();
}
return sb.ToString();
Expand Down