Skip to content

fix: implement IDisposable in LoggingTestBase to stop resource leaks - #553

Merged
dnyw4l3n13 merged 2 commits into
mainfrom
fix/460-logging-test-base-dispose
Oct 28, 2026
Merged

dnyw4l3n13 merged 2 commits into
mainfrom
fix/460-logging-test-base-dispose

Conversation

@prpixie

@prpixie prpixie commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Placeholder PR for the LoggingTestBase IDisposable fix. The implementation will follow the approved plan on #460, which covers making LoggingTestBase implement IDisposable so that resources it creates are released after each test.

This PR currently contains only a placeholder CHANGELOG.md entry. Implementation commits will be added on later cycles.

Closes #460

@prpixie prpixie added the auto-pr Pull request created automatically label Oct 27, 2026
@dnyw4l3n13 dnyw4l3n13 changed the title docs: changelog placeholder for #460 fix: implement IDisposable in LoggingTestBase to stop resource leaks Oct 27, 2026
@credfeto

credfeto commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Roslyn analyzer findings

Source Rule Level File Line Suppressed Message
DotNet PH2140 error src/FunFair.Test.Common/AssemblySettings.cs 8 yes Avoid the ExcludeFromCodeCoverage attribute
DotNet CA1000 error src/FunFair.Test.Common/ValidatorTestBase.cs 41 yes Do not declare static members on generic types
DotNet CA1000 error src/FunFair.Test.Common/ComparableValueTestBase.cs 238 yes Do not declare static members on generic types
DotNet CA2000 error src/FunFair.Test.Common/Startup/LoggingStartup.cs 28 yes Call System.IDisposable.Dispose on object created by 'new XUnitLoggerProvider(output)' before all references to it are out of scope
DotNet CA1000 error src/FunFair.Test.Common/EquatableValueTestBase.cs 236 yes Do not declare static members on generic types
DotNet CA1000 error src/FunFair.Test.Common/ComparableObjectTestBase.cs 355 yes Do not declare static members on generic types
DotNet CA1000 error src/FunFair.Test.Common/JsonConverterValueTestBase.cs 87 yes Do not declare static members on generic types
DotNet CA1000 error src/FunFair.Test.Common/JsonConverterObjectTestBase.cs 95 yes Do not declare static members on generic types
DotNet CA1000 error src/FunFair.Test.Common/EquatableObjectTestBase.cs 302 yes Do not declare static members on generic types
DotNet PH2071 error src/FunFair.Test.Common/ComparableObjectTestBase.cs 357 yes Duplicate shape found at ComparableValueTestBase.cs line 240 character 5. Refactor logic or exempt duplication. Duplicate shape details: "{ return [ DotDot Identifier < Identifier > . Identifier < Identifier > ( ) , Identifier < Identifier > ( Identifier => Identifier . Identifier ( ) ) , Identifier < Identifier > ( Identifier => Identifier . Identifier ( ) ) , Identifier < Identifier > ( Identifier => Identifier . Identifier ( ) ) , Identifier < Identifier > ( Identifier => Identifier . Identifier ( ) ) , Identifier < Identifier > ( Identifier => Identifier . Identifier ( ) ) , Identifier < Identifier > ( Identifier => Identifier . Identifier ( ) ) ,"
DotNet ExplicitToStringWithoutOverrideAnalyzer error src/FunFair.Test.Common/Helpers/Formatter.cs 17 yes Calling ToString() on object of type 'T' but it does not override ToString()
DotNet PH2071 error src/FunFair.Test.Common/EquatableObjectTestBase.cs 304 yes Duplicate shape found at EquatableValueTestBase.cs line 238 character 5. Refactor logic or exempt duplication. Duplicate shape details: "{ return [ Identifier < Identifier > ( Identifier => Identifier . Identifier ( ) ) , Identifier < Identifier > ( Identifier => Identifier . Identifier ( ) ) , Identifier < Identifier > ( Identifier => Identifier . Identifier ( ) ) , Identifier < Identifier > ( Identifier => Identifier . Identifier ( ) ) , Identifier < Identifier > ( Identifier => Identifier . Identifier ( ) ) , Identifier < Identifier > ( Identifier => Identifier . Identifier ( ) ) , Identifier < Identifier > ( Identifier => Identifier . Identifier ( ) )"
DotNet PH2140 error src/FunFair.Test.Infrastructure/AssemblySettings.cs 8 yes Avoid the ExcludeFromCodeCoverage attribute
DotNet FFS0029 error src/FunFair.Test.Infrastructure/Mocks/MockBase.cs 6 yes MockBase instances must be internal
DotNet FFS0030 error src/FunFair.Test.Infrastructure/Mocks/MockBase.cs 6 yes MockBase instances must be sealed
DotNet FFS0024 error src/FunFair.Test.Infrastructure/Mocks/MockLogger.cs 21 yes ILogger parameters on leaf classes should not be ILogger but ILogger<FunFair.Test.Infrastructure.Mocks.MockLogger>
DotNet CA2000 error src/FunFair.Test.Infrastructure/Extensions/HttpClientFactoryExtensions.cs 82 yes Call System.IDisposable.Dispose on object created by 'new FakeHttpMessageHandler(statusCode: httpStatusCode, responseMessage: responseMessage, headers: headers)' before all references to it are out of scope
DotNet CA2000 error src/FunFair.Test.Infrastructure/Extensions/HttpClientFactoryExtensions.cs 56 yes Call System.IDisposable.Dispose on object created by 'CreateFakeClient(' before all references to it are out of scope
DotNet ExplicitToStringWithoutOverrideAnalyzer error src/FunFair.Test.Infrastructure/Mocks/MockBase.cs 41 yes Calling ToString() on object of type 'T' but it does not override ToString()

@dnyw4l3n13 dnyw4l3n13 added AI-Work Work for an AI Agent High High Priority Bug Generic bug fix Performance Performance enhancement or issue labels Oct 27, 2026
@dnyw4l3n13

Copy link
Copy Markdown
Collaborator

Implemented the approved plan for #460 in 49e0327: LoggingTestBase now implements IDisposable, unsubscribes the UnobservedTaskException handler and disposes the logger factory and service provider, with regression tests for temp-folder cleanup and safe double dispose. Board is at Development; CI will run, then the next cycle continues with Simplify.

@dnyw4l3n13

Copy link
Copy Markdown
Collaborator

Simplify clean - advancing to code review

Placeholder CHANGELOG.md entry for the LoggingTestBase IDisposable fix (#460).
@dnyw4l3n13
dnyw4l3n13 force-pushed the fix/460-logging-test-base-dispose branch from 49e0327 to 8b2ff70 Compare October 27, 2026 21:34
@dnyw4l3n13

Copy link
Copy Markdown
Collaborator

Code review clean - advancing to security review

@dnyw4l3n13

Copy link
Copy Markdown
Collaborator

Security review clean, advancing to coverage check

@dnyw4l3n13

Copy link
Copy Markdown
Collaborator

Coverage ratchet passed - advancing to Human Review (changes only touch the coverage-excluded FunFair.Test.Common and its tests; measured Overall .NET stays at the baseline 97.8%).

@dnyw4l3n13
dnyw4l3n13 marked this pull request as ready for review October 27, 2026 21:53
@dnyw4l3n13
dnyw4l3n13 requested a review from a team as a code owner October 27, 2026 21:53
@dnyw4l3n13
dnyw4l3n13 enabled auto-merge October 27, 2026 21:53
@dnyw4l3n13

Copy link
Copy Markdown
Collaborator

Finalize: PR marked ready and auto-merge enabled (merge).

@dnyw4l3n13

Copy link
Copy Markdown
Collaborator

Re-ran failed lint-code job (run 40590450500): log shows ##[error]Docker pull failed - ghcr.io/super-linter/super-linter:v8.7.0 'denied: denied' (infrastructure, not code). Board stays at Human Review; auto-merge remains enabled.

@credfeto

Copy link
Copy Markdown
Member

Super-linter summary

Language Validation result

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

@dnyw4l3n13
dnyw4l3n13 merged commit 7b871d5 into main Oct 28, 2026
53 of 54 checks passed
@dnyw4l3n13
dnyw4l3n13 deleted the fix/460-logging-test-base-dispose branch October 28, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Work Work for an AI Agent auto-pr Pull request created automatically Bug Generic bug fix High High Priority Performance Performance enhancement or issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LoggingTestBase declares Dispose(bool) but never implements IDisposable - resources and event handlers leak on every test

3 participants