test: stop WebIntegrationTests.Versioning asserting an exact structured-log count - #5638
Merged
Merged
Conversation
…ed-log count StructuredLog.Length is the number of SentryLog items in the envelope batch. In this test that is however many logs ASP.NET Core's own infrastructure emits while serving one request, and they race the flush triggered by server.Dispose(), so CI alternates between 7 and 6. Ignore the member for this test rather than in IgnoreStandardSentryMembers: 19 committed snapshots contain a Length: line, two of which (the Net4_8 and Mono4_0 Serilog/NLog integration snapshots) cannot be regenerated on macOS. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## version7 #5638 +/- ##
===========================================
Coverage ? 74.75%
===========================================
Files ? 515
Lines ? 18905
Branches ? 3689
===========================================
Hits ? 14133
Misses ? 3894
Partials ? 878 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jamescrosswell
marked this pull request as ready for review
September 29, 2026 04:25
ric-oliv
self-requested a review
September 29, 2026 08:18
ric-oliv
approved these changes
Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the recurring
Sentry.AspNetCore.Tests.WebIntegrationTests.Versioningsnapshot flake onversion7.StructuredLog.Lengthis_items.Length— the number of structured log items in the envelope batch. In this test that is however many logs ASP.NET Core's own infrastructure happens to emit while serving one request, and they race the flush triggered byserver.Dispose(). CI alternates betweenLength: 7andLength: 6, so the assertion is nondeterministic by design. Most recently it failed on both linux-arm64 (net8.0) and linux-x64 (net11.0) in a single run.The fix ignores that one member for this test and regenerates the four
WebIntegrationTests.Versioning.DotNet*snapshots (Source: { Length: 7 }→Source: {}). Nothing else in them changes, and all four TFMs regenerated on macOS.Why not in
IgnoreStandardSentryMembersThe issue suggests putting the ignore in the shared
test/Sentry.Testing/VerifyExtensions.cshelper, on the basis that "only one committed snapshot contains aLength:line". That turns out not to hold — there are 19:WebIntegrationTests.Versioning.DotNet*(this test)In all 19,
Length:is the only member insideSource: { }, so it provides no real coverage anywhere. But changing the shared helper would rewrite all 19, includingIntegrationTests.Simple.Net4_8.verified.txtandIntegrationTests.Simple.Mono4_0.verified.txtin the Serilog and NLog projects, which can't be regenerated on macOS and would need hand-editing. OnlyVersioningactually flakes — the other 18 are single-threaded tests with deterministic log counts. Keeping the change local also keeps it clear of the four stacked logging PRs in flight againstversion7(#5573, #5585, #5592, #5595).Ignoring it in the shared helper is still the tidier end state; worth a follow-up alongside a CI-sourced regeneration of the .NET Framework/Mono snapshots.
maindoes not need thisOn
main,EnableLogsstill defaults tofalse, so noStructuredLogitem reaches this test's envelopes and its snapshots contain noLength:line at all. The count only became load-bearing onversion7, where #5504 made logs always enabled.maininherits the fix whenversion7merges.Unrelated to #5617 (msbuild integration-test flush timeout on net9.0 Windows) — different test, different signature.
Closes #5616
#skip-changelog
🤖 Generated with Claude Code