-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Akka.Event: restore missing log data #7256
Akka.Event: restore missing log data #7256
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Detailed my reproduction steps
@@ -55,7 +55,7 @@ let runIncrementally = hasBuildParam "incremental" | |||
let incrementalistReport = output @@ "incrementalist.txt" | |||
|
|||
// Configuration values for tests | |||
let testNetFrameworkVersion = "net471" | |||
let testNetFrameworkVersion = "net48" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upgraded to .NET 4.8 so we could use newer versions of Verify, which had DateTime
scrubbing. I ended up not needing it but I don't think it hurts anything given that this only affects the test suite.
src/Directory.Build.props
Outdated
@@ -18,8 +18,8 @@ | |||
<LangVersion>11.0</LangVersion> | |||
</PropertyGroup> | |||
<PropertyGroup> | |||
<XunitVersion>2.5.3</XunitVersion> | |||
<XunitRunnerVersion>2.5.3</XunitRunnerVersion> | |||
<XunitVersion>2.8.1</XunitVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant - we already use these newer versions on dev
but I had to capture what the logs originally should have looked like on v1.5.20, where we had not yet performed these upgrades. Verify.Xunit required the newer versions.
@@ -28,7 +28,6 @@ | |||
|
|||
namespace Akka.API.Tests | |||
{ | |||
[UsesVerify] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obsolete in the latest version of Verify
Sys.EventStream.Subscribe(probe.Ref, typeof(LogEvent)); | ||
|
||
// act | ||
using (new OutputRedirector(filePath)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error in #7255 was caused not by the formatter on the message changing, but by the fact that we started calling .ToString
on the wrong thing in v1.5.21. This test is designed to capture STDOUT and verify against that, so either type of mistake will be caught in the future should it occur again.
var text = File.ReadAllText(filePath); | ||
|
||
// need to sanitize the thread id | ||
text = SanitizeDateTime(text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scrub thread ids and datetimes, since these are unstable run-per-run even if everything is working normally.
@@ -14,6 +14,7 @@ public static class ModuleInit | |||
[ModuleInitializer] | |||
public static void Init() | |||
{ | |||
VerifyDiffPlex.Initialize(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force DiffPlex to start once at boot.
[DEBUG][DateTime][Thread 0001][ActorSystem(test)] This is a test 1 cheese | ||
[INFO][DateTime][Thread 0001][ActorSystem(test)] This is a test 1 | ||
[WARNING][DateTime][Thread 0001][ActorSystem(test)] This is a test 1 | ||
[ERROR][DateTime][Thread 0001][ActorSystem(test)] This is a test 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea why the stack trace logs don't show up on .NET Framework, but they do on .NET 8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduced the fix and detailed my changes - worried a bit about the .NET Framework 4.7.1 -> 4.8 movement breaking some stuff on the build server but we'll see.
TargetFolder: '$(Build.ArtifactStagingDirectory)/verify' | ||
displayName: 'Copy .received. files to artifact staging directory' | ||
|
||
- task: PublishBuildArtifacts@1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add .received
files from Verify as a build output whenever we have a test failure.
@@ -191,7 +191,7 @@ public virtual bool ShouldTryKeepMessage(LogEvent evt, out string expandedLogMes | |||
else | |||
{ | |||
// allocate the message just once | |||
var nullCheck = evt.Message.ToString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the fixes here - we were only looking at the message, not the entire log string.
@@ -225,7 +225,7 @@ private EmptyLogFilterEvaluator() : base(Array.Empty<LogFilterBase>()) | |||
|
|||
public override bool ShouldTryKeepMessage(LogEvent evt, out string expandedLogMessage) | |||
{ | |||
expandedLogMessage = evt.Message.ToString()!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the fix for most use cases, when users don't have any log filtering enabled.
has trouble running on Linux
@@ -16,6 +16,7 @@ | |||
|
|||
namespace DocsExamples.Streams | |||
{ | |||
#if NETCOREAPP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caused a grumble on Linux, which caused DocFx validation to fail
Looks like my reproduction spec can be racy - going to take a look at it and see what I can do about that. |
|
Output from Verfiy.received:
I think what we have here is a race condition between the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Changes
Fixes #7255
Checklist
For significant changes, please ensure that the following have been completed (delete if not relevant):