From 037a5b023107b0bbee0dd4d73e915bbf909c9283 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 11 Feb 2019 12:14:05 -0800 Subject: [PATCH] Add more logging to a failing tests and move dumps to logs directory (#7462) --- .../IIS/IIS/test/IIS.Tests/ClientDisconnectTests.cs | 12 +++++++++++- src/Servers/IIS/tools/SetupTestEnvironment.ps1 | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Servers/IIS/IIS/test/IIS.Tests/ClientDisconnectTests.cs b/src/Servers/IIS/IIS/test/IIS.Tests/ClientDisconnectTests.cs index dbe562aa7c..0b4d1af24f 100644 --- a/src/Servers/IIS/IIS/test/IIS.Tests/ClientDisconnectTests.cs +++ b/src/Servers/IIS/IIS/test/IIS.Tests/ClientDisconnectTests.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Testing.xunit; +using Microsoft.Extensions.Logging; using Xunit; namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests @@ -203,7 +204,16 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests cancellationTokenSource.Cancel(); await requestCompletedCompletionSource.Task.DefaultTimeout(); } - Assert.IsType(exception); + + try + { + Assert.IsType(exception); + } + catch (Exception e) + { + Logger.LogError(e, "Unexpected exception"); + throw; + } } } diff --git a/src/Servers/IIS/tools/SetupTestEnvironment.ps1 b/src/Servers/IIS/tools/SetupTestEnvironment.ps1 index 7a7eda0487..06ab16c132 100644 --- a/src/Servers/IIS/tools/SetupTestEnvironment.ps1 +++ b/src/Servers/IIS/tools/SetupTestEnvironment.ps1 @@ -8,7 +8,7 @@ Remove-Item "HKLM:\SOFTWARE\Microsoft\IIS Extensions\IIS AspNetCore Module V2\Pa if (!($DumpFolder)) { - $DumpFolder = "$PSScriptRoot\..\..\..\..\artifacts\dumps" + $DumpFolder = "$PSScriptRoot\..\..\..\..\artifacts\logs\dumps" } if (!(Test-Path $DumpFolder)) {