diff --git a/src/System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj b/src/System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj index 44465c5daa1e..b70ad0a70376 100644 --- a/src/System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj +++ b/src/System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj @@ -42,6 +42,7 @@ + diff --git a/src/System.IO.Pipes/tests/XunitAssemblyAttributes.cs b/src/System.IO.Pipes/tests/XunitAssemblyAttributes.cs new file mode 100644 index 000000000000..6aaf2c3d5e4d --- /dev/null +++ b/src/System.IO.Pipes/tests/XunitAssemblyAttributes.cs @@ -0,0 +1,12 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using Xunit; + +// Some tests launch processes. If other tests that run concurrently create inheritable pipes and the launched +// process inherits it, then the lifetime of those pipes will be extended beyond when the test expects, leading +// to failures due to naming conflicts and the like. On Unix this can happen even for non-inheritable pipes, as they're +// made non-inheritable via CLOEXEC, but there's still a small window between the process being forked and that +// forked process calling exec where the handle remains open in the other process. +[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly, DisableTestParallelization = true, MaxParallelThreads = 1)]