diff --git a/NuGet.config b/NuGet.config index 15e1ddd568..5cb7dc3752 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,4 +1,4 @@ - + @@ -14,6 +14,7 @@ + diff --git a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/HangDumperFactory.cs b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/HangDumperFactory.cs index e6d8575529..296c10e2df 100644 --- a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/HangDumperFactory.cs +++ b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/HangDumperFactory.cs @@ -31,18 +31,19 @@ public IHangDumper Create(string targetFramework) return new NetClientDumper(); } - // this is not supported yet - // if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - // { - - // if (frameworkVersion != default && frameworkVersion <= new Version("5.0")) - // { - // return new SigtrapDumper(); - // } - - // EqtTrace.Info($"HangDumperFactory: This is OSX on netcoreapp3.1 or newer, returning the standard NETClient library dumper."); - // return new NetClientDumper(); - // } + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + if (!string.IsNullOrWhiteSpace(targetFramework) && !targetFramework.Contains("v5.0")) + { + EqtTrace.Info($"HangDumperFactory: This is OSX on {targetFramework}, This combination of OS and framework is not supported."); + + throw new PlatformNotSupportedException($"Unsupported target framework {targetFramework} on OS {RuntimeInformation.OSDescription}"); + } + + EqtTrace.Info($"HangDumperFactory: This is OSX on net5.0 or newer, returning the standard NETClient library dumper."); + return new NetClientDumper(); + } + throw new PlatformNotSupportedException($"Unsupported operating system: {RuntimeInformation.OSDescription}"); } } diff --git a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Microsoft.TestPlatform.Extensions.BlameDataCollector.csproj b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Microsoft.TestPlatform.Extensions.BlameDataCollector.csproj index f1cef62835..a29f60e15c 100644 --- a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Microsoft.TestPlatform.Extensions.BlameDataCollector.csproj +++ b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/Microsoft.TestPlatform.Extensions.BlameDataCollector.csproj @@ -32,7 +32,7 @@ - 0.2.0-preview.20220.1 + 0.2.0-preview.20378.10 diff --git a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/NetClientDumper.cs b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/NetClientDumper.cs index 2455e0e37f..4514f09d0f 100644 --- a/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/NetClientDumper.cs +++ b/src/Microsoft.TestPlatform.Extensions.BlameDataCollector/NetClientDumper.cs @@ -4,13 +4,17 @@ namespace Microsoft.TestPlatform.Extensions.BlameDataCollector { using Microsoft.Diagnostics.NETCore.Client; + using Microsoft.VisualStudio.TestPlatform.ObjectModel; internal class NetClientDumper : IHangDumper { public void Dump(int processId, string outputFile, DumpTypeOption type) { var client = new DiagnosticsClient(processId); - client.WriteDump(type == DumpTypeOption.Full ? DumpType.Full : DumpType.Normal, outputFile); + + // Connecting the dump generation logging to verbose output to avoid changing the interfaces again + // before we test this on some big repo. + client.WriteDump(type == DumpTypeOption.Full ? DumpType.Full : DumpType.Normal, outputFile, logDumpGeneration: EqtTrace.IsVerboseEnabled); } } }