Skip to content

Commit

Permalink
Merge pull request #761 from jasonmalinowski/fix-memory-leaks
Browse files Browse the repository at this point in the history
Mitigate memory leak and disable affected tests
  • Loading branch information
jasonmalinowski committed Feb 21, 2015
2 parents d100acf + 46a6a2e commit 96f82a0
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ public class C

#endregion

[Fact]
[Fact(Skip = "GitHub Issue 759")]
[WorkItem(759)]
public void AnalyzerDriverIsSafeAgainstAnalyzerExceptions()
{
var compilation = CreateCompilationWithMscorlib45(TestResource.AllInOneCSharpCode, parseOptions: TestOptions.Regular);
Expand Down
6 changes: 4 additions & 2 deletions src/Compilers/Core/AnalyzerDriver/AnalyzerDriverHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,8 @@ internal static EventHandler<AnalyzerExceptionDiagnosticArgs> RegisterAnalyzerEx
}
};

AnalyzerExceptionDiagnostic += handler;
// TODO: re-enable once bug 759 is fixed
// AnalyzerExceptionDiagnostic += handler;
return handler;
}

Expand All @@ -529,7 +530,8 @@ internal static EventHandler<AnalyzerExceptionDiagnosticArgs> RegisterAnalyzerEx
}
};

AnalyzerExceptionDiagnostic += handler;
// TODO: re-enable once bug 759 is fixed
// AnalyzerExceptionDiagnostic += handler;
return handler;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ End Enum
CreateCompilationWithMscorlib(source).VerifyAnalyzerDiagnostics({New BasicTrackingDiagnosticAnalyzer()})
End Sub

<Fact>
<Fact(Skip:="GitHub Issue 759")>
<WorkItem(759)>
Public Sub AnalyzerDriverIsSafeAgainstAnalyzerExceptions()
Dim compilation = CreateCompilationWithMscorlib({TestResource.AllInOneVisualBasicCode})
ThrowingDiagnosticAnalyzer(Of SyntaxKind).VerifyAnalyzerEngineIsSafeAgainstExceptions(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer()
return new ExceptionThrowingSymbolAnalyzer_ThrowSymbolKindsOfInterest();
}

[Fact, Trait(Traits.Feature, Traits.Features.Diagnostics)]
[Fact(Skip = "GitHub Issue 759"), Trait(Traits.Feature, Traits.Features.Diagnostics)]
[WorkItem(759)]
public void TestTypeParameterNamesCSharp()
{
var source = @"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ class C
}
}

[Fact]
[Fact(Skip = "GitHub Issue 759")]
[WorkItem(759)]
public void DiagnosticAnalyzerDriverIsSafeAgainstAnalyzerExceptions()
{
var source = TestResource.AllInOneCSharpCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@ Namespace Microsoft.CodeAnalysis.Editor.Implementation.Diagnostics.UnitTests
End Using
End Sub

<Fact, WorkItem(937915), Trait(Traits.Feature, Traits.Features.Diagnostics)>
<Fact(Skip:="GitHub Issue 759"), WorkItem(937915), Trait(Traits.Feature, Traits.Features.Diagnostics)>
<WorkItem(759)>
Public Sub TestDiagnosticAnalyzerExceptionHandledGracefully2()
Dim test = <Workspace>
<Project Language="C#" CommonReferences="true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ End Class
End Using
End Sub

<Fact>
<Fact(Skip:="GitHub Issue 759")>
<WorkItem(759)>
Public Sub DiagnosticAnalyzerDriverIsSafeAgainstAnalyzerExceptions()
Dim source = TestResource.AllInOneVisualBasicCode
Using Workspace = VisualBasicWorkspaceFactory.CreateWorkspaceFromFile(source)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ internal abstract partial class AbstractHostDiagnosticUpdateSource
protected AbstractHostDiagnosticUpdateSource()
{
// Register for exception diagnostics from workspace's analyzer manager.
AnalyzerExceptionDiagnostic += OnAnalyzerExceptionDiagnostic;
// TODO: re-enable once bug 759 is fixed
// AnalyzerExceptionDiagnostic += OnAnalyzerExceptionDiagnostic;
}

~AbstractHostDiagnosticUpdateSource()
{
// Unregister for exception diagnostics from workspace's analyzer manager.
AnalyzerExceptionDiagnostic -= OnAnalyzerExceptionDiagnostic;
// TODO: re-enable once bug 759 is fixed
// AnalyzerExceptionDiagnostic -= OnAnalyzerExceptionDiagnostic;
}

internal static EventHandler<AnalyzerExceptionDiagnosticArgs> RegisterAnalyzerExceptionDiagnosticHandler(ImmutableArray<DiagnosticAnalyzer> analyzers, Workspace workspace)
Expand Down

0 comments on commit 96f82a0

Please sign in to comment.