Skip to content

Update memory dump dependencies - #1744

Open
bart-vmware wants to merge 2 commits into
mainfrom
update-memory-dumps
Open

bart-vmware wants to merge 2 commits into
mainfrom
update-memory-dumps

Conversation

@bart-vmware

@bart-vmware bart-vmware commented Sep 15, 2026

Copy link
Copy Markdown
Member

Description

This PR adds skipped test coverage for verifying that the intertwined dependencies needed for taking memory and thread dumps are compatible. But running these tests takes several minutes, which is why they are skipped by default. The tests compile and run a console app that takes various dumps on all supported target frameworks, while referencing packaged Steeltoe libraries from an emphemeral NuGet feed. This verifies real end-to-end usage that mirrors a Steeltoe release pushed to a package feed.

Caution

Each time dump-related Steeltoe dependencies are bumped, these tests should be run manually to verify compatibility.

This PR also updates dump-related dependencies to the latest compatible versions, so Steeltoe users benefit from minor downstream fixes accross the board.

Why do we need such tests?

Steeltoe.Management.Endpoint references the following NuGet packages:

  1. Microsoft.Diagnostics.NETCore.Client (used to obtain heap dumps)
  2. Microsoft.Diagnostics.Tracing.TraceEvent (used to obtain stack traces)
    • Embeds a private copy of Microsoft.Diagnostics.FastSerialization.dll **
    • References package Microsoft.Diagnostics.NETCore.Client from above
  3. dotnet-gcdump (embedded, because global tools can't be referenced)
    • Embeds a private copy of Microsoft.Diagnostics.FastSerialization.dll **

** It's fine when dotnet-gcdump is compiled against a different version of Microsoft.Diagnostics.FastSerialization.dll, as long as it is binary compatible. If not, a TypeLoadException or MissingMethodException is thrown at runtime (so when taking the dump).

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.

@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 87.3% 79.4%
Steeltoe.Common.Certificates 95.6% 84.5%
Steeltoe.Common.Hosting 83.5% 65%
Steeltoe.Common.Http 97.4% 80.9%
Steeltoe.Common.Logging 80.6% 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 91.6% 86.2%
Steeltoe.Configuration.Encryption 97.6% 87.8%
Steeltoe.Configuration.Kubernetes.ServiceBindings 95.6% 82.6%
Steeltoe.Configuration.Placeholder 93.8% 82.6%
Steeltoe.Configuration.RandomValue 93.2% 83.3%
Steeltoe.Configuration.SpringBoot 98.3% 85%
Steeltoe.Connectors 94.4% 85.3%
Steeltoe.Connectors.EntityFrameworkCore 81% 65.3%
Steeltoe.Discovery.Configuration 96.3% 75%
Steeltoe.Discovery.Consul 91.5% 83.8%
Steeltoe.Discovery.Eureka 91.8% 81.9%
Steeltoe.Discovery.HttpClients 89.9% 91.4%
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 96% 87.1%
Steeltoe.Management.GitProperties.Build 95.1% 83.9%
Steeltoe.Management.Prometheus 95.8% 76.9%
Steeltoe.Management.Tasks 95.2% 80%
Steeltoe.Management.Tracing 100% 75%
Steeltoe.Security.Authentication.JwtBearer 100% 93.7%
Steeltoe.Security.Authentication.OpenIdConnect 87.7% 66.6%
Steeltoe.Security.Authorization.Certificate 96.8% 66.6%
Steeltoe.Security.DataProtection.Redis 100% ****

@sonarqubecloud

Copy link
Copy Markdown

@bart-vmware
bart-vmware marked this pull request as ready for review September 18, 2026 11:31
@bart-vmware
bart-vmware requested a review from TimHess September 18, 2026 11:31
Comment on lines +388 to +389
string projectPath = GetAppProjectFile(testLibraryName, targetFramework);
await File.WriteAllTextAsync(projectFilePath, projectPath);

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.

Suggested change
string projectPath = GetAppProjectFile(testLibraryName, targetFramework);
await File.WriteAllTextAsync(projectFilePath, projectPath);
string projectFileContents = GetAppProjectFile(testLibraryName, targetFramework);
await File.WriteAllTextAsync(projectFilePath, projectFileContents);

[MemberData(nameof(TestTargetFrameworks))]
public async Task Can_take_gcdump_from_packaged_Steeltoe_library(string targetFramework)
{
Assert.SkipWhen(!IsHighestTestHostFramework(), "Running this test only on the latest .NET SDK is sufficient.");

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.

Suggested change
Assert.SkipWhen(!IsHighestTestHostFramework(), "Running this test only on the latest .NET SDK is sufficient.");
Assert.SkipWhen(!IsHighestTestHostFramework(),
$"This test only needs to run once, under the highest target framework ({ResolveTestTargetFrameworks().Max(...)}). " +
$"Switch your run configuration's target framework if this is unexpectedly skipped.");

Not a huge deal, but perhaps we could use a more dynamic and precise message, for cases when the IDE auto-selects an unexpected framework? For example, I ran the tests in Rider and it selected .net8 for me the first time and it took a couple minutes to identify exactly what went wrong

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