Skip to content

test: stabilize cancellation metric assertion - #75

Merged
xavierjohn merged 1 commit into
mainfrom
test/stabilize-cancellation-metric
Oct 13, 2026
Merged

xavierjohn merged 1 commit into
mainfrom
test/stabilize-cancellation-metric

Conversation

@xavierjohn

Copy link
Copy Markdown
Owner

Summary

  • wait for the actual MeterListener callback after HttpContext.Abort()
  • bound the wait to five seconds so a missing metric fails deterministically
  • leave production middleware behavior unchanged

Root cause

The TestServer client can observe the aborted response before the server-side middleware disposes MeasuredOperation and records the histogram. The assertion therefore raced the callback even though the measurement was emitted moments later.

Validation

  • cancellation metric test passed 30/30 fresh-process runs
  • full ASP.NET SLI test suite passed (36/36)

Copilot-Session: cb09eb5c-48fc-420c-99e5-91a0eb7bc374
@github-actions

Copy link
Copy Markdown

Test Results

102 tests  ±0   102 ✅ ±0   14s ⏱️ ±0s
  3 suites ±0     0 💤 ±0 
  3 files   ±0     0 ❌ ±0 

Results for commit 5f6d589. ± Comparison against base commit 043ba84.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.17%. Comparing base (043ba84) to head (5f6d589).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #75   +/-   ##
=======================================
  Coverage   83.17%   83.17%           
=======================================
  Files          23       23           
  Lines         434      434           
  Branches       70       70           
=======================================
  Hits          361      361           
  Misses         56       56           
  Partials       17       17           

☔ 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.

@xavierjohn
xavierjohn merged commit 92c0c5e into main Oct 13, 2026
2 checks passed
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