aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Make StackTraceHelper tests runtime-agnostic

Open medhatiwari opened this issue 3 months ago • 7 comments

Summary

Fixes the remaining 2 failing StackTraceHelper tests from #63927 by making tests runtime-agnostic instead of expecting exact string matches for runtime internals.

Problem

Tests were failing on Mono due to strict string matching against runtime-specific formatting:

  • Lambda methods: Expected "lambda_method34" but Mono shows "object.lambda_method34"
  • Async state machines: Expected resolved method names but Mono shows state machine internals

Solution

Updated tests to verify essential functionality while accepting different valid runtime behaviors:

  • Lambda test: Changed from Assert.StartsWith("lambda_method") to Assert.Contains("lambda_method")
  • Async test: Added flexible checks that accept both resolved method names and state machine forms

cc: @giritrivedi

medhatiwari avatar Oct 12 '25 10:10 medhatiwari

Thank you so much for your contribution @medhatiwari! Left a small comment that would be good if you could address, but otherwise this is looking really good 😃

joperezr avatar Oct 21 '25 16:10 joperezr

Thank you so much for your contribution @medhatiwari! Left a small comment that would be good if you could address, but otherwise this is looking really good 😃

Thanks for reviewing the PR

medhatiwari avatar Oct 21 '25 17:10 medhatiwari

Can this be merged ?

giritrivedi avatar Oct 28 '25 06:10 giritrivedi

/azp run

giritrivedi avatar Nov 06 '25 09:11 giritrivedi

Commenter does not have sufficient privileges for PR 64007 in repo dotnet/aspnetcore

azure-pipelines[bot] avatar Nov 06 '25 09:11 azure-pipelines[bot]

@wtgodbe any idea around the test failures? Unless I'm missing something obvious it seems like they are unrelated to this PR. Would be good to finally get this contribution merged 😃

joperezr avatar Dec 10 '25 21:12 joperezr