diff --git a/eng/pipelines/installer/jobs/base-job.yml b/eng/pipelines/installer/jobs/base-job.yml index f40ab73d7d428..e6951a56e8160 100644 --- a/eng/pipelines/installer/jobs/base-job.yml +++ b/eng/pipelines/installer/jobs/base-job.yml @@ -252,6 +252,7 @@ jobs: value: | set -x df -h + docker info $(RunArguments) $(BuildScript) $(BuildArguments) ### diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/SingleFileSharedState.cs b/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/SingleFileSharedState.cs index 7051c3fa327d5..d729ad0e22390 100644 --- a/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/SingleFileSharedState.cs +++ b/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/SingleFileSharedState.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using Microsoft.DotNet; using Microsoft.DotNet.CoreSetup.Test; using Xunit; using static AppHost.Bundle.Tests.BundleTestBase; @@ -15,10 +16,17 @@ public class SingleFileSharedState : SharedTestStateBase, IDisposable public SingleFileSharedState() { - // We include mockcoreclr in our project to test native binaries extraction. - string mockCoreClrPath = Path.Combine(RepoDirectories.Artifacts, "corehost_test", - RuntimeInformationExtensions.GetSharedLibraryFileNameForCurrentPlatform("mockcoreclr")); - TestFixture = PreparePublishedSelfContainedTestProject("SingleFileApiTests", $"/p:AddFile={mockCoreClrPath}"); + try + { + // We include mockcoreclr in our project to test native binaries extraction. + string mockCoreClrPath = Path.Combine(RepoDirectories.Artifacts, "corehost_test", + RuntimeInformationExtensions.GetSharedLibraryFileNameForCurrentPlatform("mockcoreclr")); + TestFixture = PreparePublishedSelfContainedTestProject("SingleFileApiTests", $"/p:AddFile={mockCoreClrPath}"); + } + catch (Exception e) when (TestUtils.FailFast(e)) // Fail fast to gather a crash dump + { + throw; + } } public void Dispose() diff --git a/src/installer/tests/TestUtils/TestUtils.cs b/src/installer/tests/TestUtils/TestUtils.cs new file mode 100644 index 0000000000000..c2f42d7514c22 --- /dev/null +++ b/src/installer/tests/TestUtils/TestUtils.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Diagnostics; + +namespace Microsoft.DotNet +{ + public static class TestUtils + { + public static bool FailFast(Exception e) + { + if (Debugger.IsAttached) + { + Debugger.Break(); + } + + Environment.FailFast(e.ToString(), e); + // Should never happen + throw new InvalidOperationException(); + } + } +} \ No newline at end of file