From f81ea4fb78fdfe3157bd764fb9b0791df9726623 Mon Sep 17 00:00:00 2001 From: Iman Narasamdya Date: Tue, 31 Oct 2023 02:11:25 +0000 Subject: [PATCH] Merged PR 748973: Apply XUnit patch to fix concurrency issue in XUnit's DependencyContextAssemblyCache Apply XUnit patch to fix concurrency issue in XUnit's DependencyContextAssemblyCache. For details, see https://github.com/xunit/xunit/pull/1846 Related work items: #2111327 --- .../Public/Managed/Testing/XUnit/xunit.dsc | 5 ++++ .../Managed/Testing/XUnit/xunitframework.dsc | 5 +++- cg/nuget/cgmanifest.json | 27 +++++++++++++++++++ config.dsc | 3 +++ 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/Public/Sdk/Public/Managed/Testing/XUnit/xunit.dsc b/Public/Sdk/Public/Managed/Testing/XUnit/xunit.dsc index b851daf47..f184db640 100644 --- a/Public/Sdk/Public/Managed/Testing/XUnit/xunit.dsc +++ b/Public/Sdk/Public/Managed/Testing/XUnit/xunit.dsc @@ -8,6 +8,11 @@ import {isDotNetCore} from "Sdk.Managed.Shared"; export const xunitConsolePackage = importFrom("xunit.runner.console").Contents.all; +// This package is published by Dotnet Arcade and contains some important fixes we need, when +// running on .NETCoreApp 3.0, see: https://github.com/dotnet/arcade/tree/master/src/Microsoft.DotNet.XUnitConsoleRunner +// For the issue, see: https://github.com/xunit/xunit/pull/1846 +export const xunitNetCoreConsolePackage = importFrom("Microsoft.DotNet.XUnitConsoleRunner").Contents.all; + /** * Evaluate (i.e. schedule) xUnit test runner invocation with specified arguments. */ diff --git a/Public/Sdk/Public/Managed/Testing/XUnit/xunitframework.dsc b/Public/Sdk/Public/Managed/Testing/XUnit/xunitframework.dsc index b1f647b1d..14619b32b 100644 --- a/Public/Sdk/Public/Managed/Testing/XUnit/xunitframework.dsc +++ b/Public/Sdk/Public/Managed/Testing/XUnit/xunitframework.dsc @@ -69,7 +69,10 @@ const additionalNetCoreRuntimeContent = isDotNetCore(qualifier.targetFramework) // into a self-contained deployment or treat it as a framework-dependent deployment as intended, let's do the latter ...(getXunitConsoleRuntimeConfigNetCoreAppFiles()), xunitConsolePackage.getFile(r`/tools/netcoreapp2.0/xunit.runner.utility.netcoreapp10.dll`), - xunitConsolePackage.getFile(r`/tools/netcoreapp2.0/xunit.console.dll`) + + // Note that below we are using different console runner due to this bug https://github.com/xunit/xunit/pull/1846 + // that the xunit maintainer does not want to fix. Let's consider removing this patch when we upgrade to xunit 3.0. + xunitNetCoreConsolePackage.getFile(r`/lib/netcoreapp2.0/xunit.console.dll`) ] : []; diff --git a/cg/nuget/cgmanifest.json b/cg/nuget/cgmanifest.json index c13c78024..4174cf789 100644 --- a/cg/nuget/cgmanifest.json +++ b/cg/nuget/cgmanifest.json @@ -1180,6 +1180,15 @@ } } }, + { + "Component": { + "Type": "NuGet", + "NuGet": { + "Name": "Microsoft.DotNet.XUnitConsoleRunner", + "Version": "2.5.1-beta.19270.4" + } + } + }, { "Component": { "Type": "NuGet", @@ -4699,6 +4708,24 @@ } } }, + { + "Component": { + "Type": "NuGet", + "NuGet": { + "Name": "xunit.runner.reporters", + "Version": "2.5.3" + } + } + }, + { + "Component": { + "Type": "NuGet", + "NuGet": { + "Name": "xunit.runner.utility", + "Version": "2.5.3" + } + } + }, { "Component": { "Type": "NuGet", diff --git a/config.dsc b/config.dsc index e1e227578..48937ba97 100644 --- a/config.dsc +++ b/config.dsc @@ -234,6 +234,9 @@ config({ { id: "xunit.extensibility.execution", version: "2.5.3" }, { id: "xunit.runner.console", version: "2.5.3" }, { id: "xunit.runner.visualstudio", version: "2.5.3" }, + { id: "xunit.runner.utility", version: "2.5.3" }, + { id: "xunit.runner.reporters", version: "2.5.3" }, + { id: "Microsoft.DotNet.XUnitConsoleRunner", version: "2.5.1-beta.19270.4" }, // microsoft test platform { id: "Microsoft.TestPlatform.TestHost", version: "16.4.0"},