Skip to content

Commit 64487c8

Browse files
committed
Remove eventlisterner guard
It appears it was only used for an old bug and it makes this class harder to read and understand.
1 parent c63865c commit 64487c8

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

test/HelixTasks/AssemblyScheduler.cs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,6 @@ public AssemblyPartitionInfo(string assemblyPath)
3535

3636
public sealed class AssemblyScheduler
3737
{
38-
/// <summary>
39-
/// This is a test class inserted into assemblies to guard against a .NET desktop bug. The tests
40-
/// inside of it counteract the underlying issue. If this test is included in any assembly it
41-
/// must be added to every partition to ensure the work around is present
42-
///
43-
/// https://github.com/dotnet/corefx/issues/3793
44-
/// https://github.com/dotnet/roslyn/issues/8936
45-
/// </summary>
46-
private const string EventListenerGuardFullName = "Microsoft.CodeAnalysis.UnitTests.EventListenerGuard";
4738

4839
private readonly struct TypeInfo
4940
{
@@ -78,23 +69,20 @@ private sealed class AssemblyInfoBuilder
7869
private readonly StringBuilder _builder = new();
7970
private readonly string _assemblyPath;
8071
private readonly int _methodLimit;
81-
private readonly bool _hasEventListenerGuard;
8272
private readonly bool _netFramework;
8373
private int _currentId;
8474
private List<TypeInfo> _currentTypeInfoList = new();
8575

86-
private AssemblyInfoBuilder(string assemblyPath, int methodLimit, bool hasEventListenerGuard, bool netFramework = false)
76+
private AssemblyInfoBuilder(string assemblyPath, int methodLimit, bool netFramework = false)
8777
{
8878
_assemblyPath = assemblyPath;
8979
_methodLimit = methodLimit;
90-
_hasEventListenerGuard = hasEventListenerGuard;
9180
_netFramework = netFramework;
9281
}
9382

9483
internal static void Build(string assemblyPath, int methodLimit, List<TypeInfo> typeInfoList, out List<Partition> partitionList, out List<AssemblyPartitionInfo> assemblyInfoList, bool netFramework = false)
9584
{
96-
var hasEventListenerGuard = typeInfoList.Any(x => x.FullName == EventListenerGuardFullName);
97-
var builder = new AssemblyInfoBuilder(assemblyPath, methodLimit, hasEventListenerGuard, netFramework);
85+
var builder = new AssemblyInfoBuilder(assemblyPath, methodLimit, netFramework);
9886
builder.Build(typeInfoList);
9987
partitionList = builder._partitionList;
10088
assemblyInfoList = builder._assemblyInfoList;
@@ -131,12 +119,6 @@ private void BeginPartition()
131119
_currentId++;
132120
_currentTypeInfoList = new List<TypeInfo>();
133121
_builder.Length = 0;
134-
135-
// Ensure the EventListenerGuard is in every partition.
136-
if (_hasEventListenerGuard)
137-
{
138-
_builder.Append($@"-class ""{EventListenerGuardFullName}"" ");
139-
}
140122
}
141123

142124
private void CheckForPartitionLimit(bool done)

0 commit comments

Comments
 (0)