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

Fix hangdump running into crashdump #4378

Merged
merged 12 commits into from
Apr 24, 2023
Prev Previous commit
Next Next commit
Review feedback
  • Loading branch information
nohwnd committed Apr 11, 2023
commit 442ba9308998c55a09b35ae56d922e2eb53ae6d2
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ public void DetachFromTargetProcess(int targetProcessId)
return;
}

// Process? procDumpCancelProcess = null;
try
{
if (_isCrashDumpInProgress)
Expand Down Expand Up @@ -284,9 +283,10 @@ public IEnumerable<string> GetDumpFiles(bool processCrashed, DateTime? testSessi
EqtTrace.Verbose($"There was 1 {nameof(_crashDumpTimestamps)} and the test session did end. Comparing timestamps to see if we should keep the crashdump.");
// When session ended, and we created a dump within 100ms around it, it was most likely an
// on process exit dump, and we don't need to keep that, unless the user overrides it (e.g. by specifying CollectAlways).
var timestampDiff = Math.Abs((_crashDumpTimestamps.Last() - (DateTime)testSessionEndedTimestamp!).TotalMilliseconds);
var crashDumpTimestamp = _crashDumpTimestamps.Last();
var timestampDiff = Math.Abs((crashDumpTimestamp - (DateTime)testSessionEndedTimestamp!).TotalMilliseconds);
var isCrashDump = timestampDiff > 100;
EqtTrace.Verbose($"{nameof(_crashDumpTimestamps)}: {_crashDumpTimestamps.Last().ToString("o", CultureInfo.InvariantCulture)}, {nameof(testSessionEndedTimestamp)}: {((DateTime)testSessionEndedTimestamp!).ToString("o", CultureInfo.InvariantCulture)}. The difference between the events is {timestampDiff} ms.");
EqtTrace.Verbose($"{nameof(_crashDumpTimestamps)}: {crashDumpTimestamp.ToString("o", CultureInfo.InvariantCulture)}, {nameof(testSessionEndedTimestamp)}: {((DateTime)testSessionEndedTimestamp!).ToString("o", CultureInfo.InvariantCulture)}. The difference between the events is {timestampDiff} ms.");
crashDumpDetected = isCrashDump;
}

Expand Down