Disable cache clearing S.CM.TC test from running in parallel (#52428)
authorDan Moseley <danmose@microsoft.com>
Fri, 7 May 2021 15:05:51 +0000 (08:05 -0700)
committerGitHub <noreply@github.com>
Fri, 7 May 2021 15:05:51 +0000 (08:05 -0700)
src/libraries/System.ComponentModel.TypeConverter/tests/ReflectionCachesUpdateHandlerTests.cs
src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptorTests.cs

index c34174e..905a580 100644 (file)
@@ -7,6 +7,7 @@ using Xunit;
 namespace System.ComponentModel.Tests
 {
     [SimpleUpdateTest]
+    [Collection("NoParallelTests")] // Clears the cache which disrupts concurrent tests
     public class ReflectionCachesUpdateHandlerTests
     {
         [Fact]
@@ -15,7 +16,7 @@ namespace System.ComponentModel.Tests
             AttributeCollection ac1 = TypeDescriptor.GetAttributes(typeof(ReflectionCachesUpdateHandlerTests));
             AttributeCollection ac2 = TypeDescriptor.GetAttributes(typeof(ReflectionCachesUpdateHandlerTests));
             Assert.Equal(ac1.Count, ac2.Count);
-            Assert.Equal(1, ac1.Count);
+            Assert.Equal(2, ac1.Count);
             Assert.Same(ac1[0], ac2[0]);
 
             MethodInfo clearCache = typeof(TypeDescriptionProvider).Assembly.GetType("System.ComponentModel.ReflectionCachesUpdateHandler", throwOnError: true).GetMethod("ClearCache");
index 94d3a97..a142fe5 100644 (file)
@@ -10,6 +10,7 @@ using Xunit;
 
 namespace System.ComponentModel.Tests
 {
+    [Collection("NoParallelTests")] // manipulates cache
     public class TypeDescriptorTests
     {
         [Fact]