Skip to content

test: flush explicitly in the msbuild integration test app - #5689

Merged
ric-oliv merged 1 commit into
mainfrom
fix/msbuild-flush-flake-5617
Oct 8, 2026
Merged

ric-oliv merged 1 commit into
mainfrom
fix/msbuild-flush-flake-5617

Conversation

@jamescrosswell

Copy link
Copy Markdown
Collaborator

The app generated by the msbuild integration test never flushed explicitly, so delivering its only event depended on the ProcessExit handler, which gives up after the default 2s ShutdownTimeout. On a loaded Windows runner, the first HttpClient.SendAsync from a cold process can take longer than that. In both failing runs the background worker never logged "Envelope handed off to transport" before the flush timed out, and the mock server got no POST.

The app now calls SentrySdk.Flush(TimeSpan.FromSeconds(30)) after capturing. That's also what we recommend for short-lived apps. The using System; is needed because the net5.0 context builds with SDK 5.0.400, which has no implicit usings.

None of the other Pester tests make the same assumption: aot.Tests.ps1 doesn't assert on envelopes, runtime.Tests.ps1 and net4-console use a FakeTransport that writes synchronously to stdout, and the native-crash and mobile tests send through the native SDKs.

Closes #5617

#skip-changelog

🤖 Generated with Claude Code

The generated app relied on the ProcessExit handler to flush its only
event within the 2s default ShutdownTimeout. On a loaded Windows runner
the first HttpClient send from a cold process can take longer than that,
so the envelope was dropped and the assertion failed.

Closes #5617

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.12%. Comparing base (8973c9b) to head (92c180c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5689      +/-   ##
==========================================
- Coverage   75.21%   75.12%   -0.09%     
==========================================
  Files         515      515              
  Lines       18989    18989              
  Branches     3693     3693              
==========================================
- Hits        14282    14265      -17     
- Misses       3852     3868      +16     
- Partials      855      856       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jamescrosswell
jamescrosswell marked this pull request as ready for review October 7, 2026 20:46
@github-actions github-actions Bot added the risk: low PR risk score: low label Oct 7, 2026

@ric-oliv ric-oliv 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.

Nice!

@ric-oliv
ric-oliv merged commit c48b920 into main Oct 8, 2026
40 checks passed
@ric-oliv
ric-oliv deleted the fix/msbuild-flush-flake-5617 branch October 8, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky: msbuild integration test times out flushing at process exit (net9.0, Windows)

2 participants