Skip to content

Fix resource leaks in tests related to missing host Start/Stop - #1759

Merged
bart-vmware merged 7 commits into
mainfrom
stop-started-hosts-in-tests
Oct 20, 2026
Merged

bart-vmware merged 7 commits into
mainfrom
stop-started-hosts-in-tests

Conversation

@bart-vmware

@bart-vmware bart-vmware commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Description

Fixes various leaks in tests related to not starting or stopping the host. Tests now wrap hosts in HostWrapper, which stops a started host before disposing it, so hosted services like discovery clients, refresh loops and logger threads no longer outlive the test. It also fixes two configuration roots that were never disposed and stops the Loggers*Test classes from disposing the container's logger factory early.

This is test-only; no changes to library code.

Quality checklist

  • Your code complies with our Coding Style.
  • You've updated unit and/or integration tests for your change, where applicable.
  • You've updated documentation for your change, where applicable.
    If your change affects other repositories, such as Documentation and/or Samples, add linked PRs here.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.
  • You've added required license files and/or file headers (explaining where the code came from with proper attribution), where code is copied from StackOverflow, a blog, or OSS.

@bart-vmware
bart-vmware marked this pull request as ready for review October 19, 2026 16:17
@bart-vmware
bart-vmware requested a review from TimHess October 19, 2026 16:17
@github-actions

Copy link
Copy Markdown
Contributor

Summary - All Code Coverage (ubuntu-latest)

Line coverage Branch coverage

Assembly Line coverage Branch coverage
Steeltoe.Bootstrap.AutoConfiguration 97.4% 83.3%
Steeltoe.Common 92.9% 84.4%
Steeltoe.Common.Certificates 95.6% 83.3%
Steeltoe.Common.Hosting 83.5% 65%
Steeltoe.Common.Http 97.2% 80.9%
Steeltoe.Common.Logging 82.9% 56.2%
Steeltoe.Common.Net 64.5% 66.6%
Steeltoe.Configuration.Abstractions 96.3% 89.4%
Steeltoe.Configuration.CloudFoundry 98.4% 92.7%
Steeltoe.Configuration.ConfigServer 92.4% 87.9%
Steeltoe.Configuration.Encryption 97.6% 87.5%
Steeltoe.Configuration.Kubernetes.ServiceBindings 95.6% 82.1%
Steeltoe.Configuration.Placeholder 94% 82.6%
Steeltoe.Configuration.RandomValue 93.2% 83.3%
Steeltoe.Configuration.SpringBoot 98.3% 85%
Steeltoe.Connectors 94.5% 85.5%
Steeltoe.Connectors.EntityFrameworkCore 81% 70.8%
Steeltoe.Discovery.Configuration 96.3% 75%
Steeltoe.Discovery.Consul 91.5% 84.5%
Steeltoe.Discovery.Eureka 90% 81.3%
Steeltoe.Discovery.HttpClients 89.9% 91.1%
Steeltoe.Logging.Abstractions 99.4% 95.6%
Steeltoe.Logging.DynamicConsole 100% 92.3%
Steeltoe.Logging.DynamicSerilog 99.1% 95.4%
Steeltoe.Management.Abstractions 100% 100%
Steeltoe.Management.Endpoint 95.9% 86.9%
Steeltoe.Management.GitProperties.Build 95.2% 83.9%
Steeltoe.Management.Prometheus 96.8% 81.2%
Steeltoe.Management.Tasks 95.2% 80%
Steeltoe.Management.Tracing 100% 75%
Steeltoe.Security.Authentication.JwtBearer 100% 95.6%
Steeltoe.Security.Authentication.OpenIdConnect 87.8% 77.2%
Steeltoe.Security.Authorization.Certificate 96.8% 66.6%
Steeltoe.Security.DataProtection.Redis 100% ****

@sonarqubecloud

Copy link
Copy Markdown

Comment thread src/Common/test/TestResources/HostWrapper.cs
@bart-vmware
bart-vmware requested a review from TimHess October 20, 2026 09:03

@TimHess TimHess left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bart-vmware
bart-vmware merged commit 02a9f28 into main Oct 20, 2026
24 checks passed
@bart-vmware
bart-vmware deleted the stop-started-hosts-in-tests branch October 20, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants