Skip to content

Commit

Permalink
Fix failing assertions on tests (#3761)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink authored Jun 14, 2022
1 parent b718639 commit b43adb1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public override void Initialize(
/// </summary>
private void CollectDumpAndAbortTesthost()
{
TPDebug.Assert(_logger != null && _context != null && _targetFramework != null && _dataCollectionSink != null, "Initialize must be called before calling this method");
TPDebug.Assert(_logger != null && _context != null && _dataCollectionSink != null, "Initialize must be called before calling this method");
_inactivityTimerAlreadyFired = true;

string value;
Expand Down Expand Up @@ -236,7 +236,7 @@ private void CollectDumpAndAbortTesthost()
{
Action<string> logWarning = m => _logger.LogWarning(_context.SessionDataCollectionContext, m);
var dumpDirectory = GetDumpDirectory();
_processDumpUtility.StartHangBasedProcessDump(_testHostProcessId, dumpDirectory, _hangDumpType == HangDumpType.Full, _targetFramework, logWarning);
_processDumpUtility.StartHangBasedProcessDump(_testHostProcessId, dumpDirectory, _hangDumpType == HangDumpType.Full, _targetFramework!, logWarning);
hangDumpSuccess = true;
}
catch (Exception ex)
Expand Down Expand Up @@ -543,13 +543,13 @@ private void TestHostLaunchedHandler(object sender, TestHostLaunchedEventArgs ar
return;
}

TPDebug.Assert(_logger != null && _context != null && _targetFramework != null, "Initialize must be called before calling this method");
TPDebug.Assert(_logger != null && _context != null, "Initialize must be called before calling this method");

try
{
var dumpDirectory = GetDumpDirectory();
Action<string> logWarning = m => _logger.LogWarning(_context.SessionDataCollectionContext, m);
_processDumpUtility.StartTriggerBasedProcessDump(args.TestHostProcessId, dumpDirectory, _crashDumpType == CrashDumpType.Full, _targetFramework, _collectDumpAlways, logWarning);
_processDumpUtility.StartTriggerBasedProcessDump(args.TestHostProcessId, dumpDirectory, _crashDumpType == CrashDumpType.Full, _targetFramework!, _collectDumpAlways, logWarning);
}
catch (TestPlatformException e)
{
Expand Down

0 comments on commit b43adb1

Please sign in to comment.