Skip to content

test: add ASP.NET Core blocking detection integration tests - #5578

Open
z0rimo wants to merge 1 commit into
getsentry:mainfrom
z0rimo:test/aspnetcore-blocking-detection-5394
Open

z0rimo wants to merge 1 commit into
getsentry:mainfrom
z0rimo:test/aspnetcore-blocking-detection-5394

Conversation

@z0rimo

@z0rimo z0rimo commented Sep 14, 2026

Copy link
Copy Markdown

Summary

Adds ASP.NET Core integration coverage for CaptureBlockingCalls.

The tests verify that:

  • multiple requests create transient SentryMiddleware instances while reusing the same IBlockingMonitor and TaskBlockingListener
  • a synchronous blocking call is captured as a Sentry event with the BlockingCallDetector mechanism
  • disabling CaptureBlockingCalls avoids creating the blocking detector services and does not capture a blocking-call event

This uses the existing TestServer integration test infrastructure and does not change production code.

Fixes #5394

Testing

NO_MOBILE=true dotnet test test/Sentry.AspNetCore.Tests/Sentry.AspNetCore.Tests.csproj -f net10.0

Passed: 289
Failed: 0
Skipped: 0

The three new tests were also run 10 consecutive times with no failures.

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add integration tests for CaptureBlockingCalls blocking detection

1 participant