re-enable and fix the SetOutReadToEnd test (#62200)
authorAdam Sitnik <adam.sitnik@gmail.com>
Wed, 1 Dec 2021 08:27:17 +0000 (09:27 +0100)
committerGitHub <noreply@github.com>
Wed, 1 Dec 2021 08:27:17 +0000 (09:27 +0100)
src/libraries/System.Console/tests/SetOut.cs
src/libraries/System.Console/tests/System.Console.Tests.csproj

index 83d0f95..c1a893c 100644 (file)
@@ -5,6 +5,7 @@ using System;
 using System.IO;
 using Xunit;
 
+[Collection(nameof(DisableParallelization))] // Console.Out is a static singleton, other tests should not be using it at the same time
 public class SetOut
 {
     [Fact]
@@ -28,7 +29,6 @@ public class SetOut
     }
 
     [Fact]
-    [ActiveIssue("https://github.com/dotnet/runtime/issues/57935", TestPlatforms.AnyUnix)]
     public static void SetOutReadToEnd()
     {
         Helpers.SetAndReadHelper(tw => Console.SetOut(tw), () => Console.Out, sr => sr.ReadToEnd());
index f92a0cd..3c83ac5 100644 (file)
@@ -28,6 +28,8 @@
              Link="Common\System\IO\InterceptStreamWriter.cs" />
     <Compile Include="$(CommonTestPath)System\ShouldNotBeInvokedException.cs"
              Link="Common\System\ShouldNotBeInvokedException.cs" />
+    <Compile Include="$(CommonTestPath)TestUtilities\System\DisableParallelization.cs"
+             Link="Common\TestUtilities\System\DisableParallelization.cs" />
     <Compile Include="WindowAndCursorProps.cs" />
   </ItemGroup>
   <ItemGroup>