runtime icon indicating copy to clipboard operation
runtime copied to clipboard

System.Net.Http.Functional.Tests: Exception type was not an exact match

Open jkotas opened this issue 5 months ago • 3 comments
trafficstars

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1057538 Build error leg or test failing: System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest.GetAsync_IncompleteData_ThrowsHttpRequestException Pull request: https://github.com/dotnet/runtime/pull/115339

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": ["System.Net.Http.Functional.Tests","Assert.Throws() Failure: Exception type was not an exact match"],
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: :mag_right: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1057538 Error message validated: [System.Net.Http.Functional.Tests Assert.Throws() Failure: Exception type was not an exact match] Result validation: :white_check_mark: Known issue matched with the provided build. Validation performed at: 6/3/2025 7:55:49 PM UTC

Report

Build Definition Test Pull Request
1067068 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution dotnet/runtime#116619
1066780 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_DiagnosticsTest_Http3.SendAsync_OperationCanceledException_RecordsActivitiesWithCorrectErrorInfo dotnet/runtime#113697
1065070 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_DiagnosticsTest_Http3.SendAsync_OperationCanceledException_RecordsActivitiesWithCorrectErrorInfo dotnet/runtime#116383
1064489 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution dotnet/runtime#116481
1064243 dotnet/runtime System.Net.Http.Functional.Tests.WorkItemExecution dotnet/runtime#113956
1057538 dotnet/runtime System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpClientHandlerTest.GetAsync_IncompleteData_ThrowsHttpRequestException dotnet/runtime#115339

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
1 5 6

jkotas avatar Jun 03 '25 19:06 jkotas

Full log:

[FAIL] System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpRequestErrorTest_Http30.SecureConnectionError
Assert.Throws() Failure: Exception type was not an exact match
Expected: typeof(System.Net.Http.HttpRequestException)
Actual:   typeof(Xunit.Sdk.SameException)
---- Assert.Same() Failure: Values are not the same instance
Expected: Activity { ActivityTraceFlags = None, Baggage = [], Context = System.Diagnostics.ActivityContext, DisplayName = "parent", Duration = 00:00:00, ··· }
Actual:   null
--- End of stack trace from previous location ---
   at System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpRequestErrorTest.<<SecureConnectionError>b__3_0>d.MoveNext() + 0x242
--- End of stack trace from previous location ---
   at System.Threading.Tasks.TaskTimeoutExtensions.GetRealException(Task task) + 0x22
--- End of stack trace from previous location ---
   at System.Threading.Tasks.TaskTimeoutExtensions.<WhenAllOrAnyFailed>d__10.MoveNext() + 0x1bf
--- End of stack trace from previous location ---
   at System.Net.Test.Common.LoopbackServerFactory.<>c__DisplayClass6_0.<<CreateClientAndServerAsync>b__0>d.MoveNext() + 0x6c
--- End of stack trace from previous location ---
   at System.Net.Test.Common.Http3LoopbackServerFactory.<CreateServerAsync>d__7.MoveNext() + 0xb8
--- End of stack trace from previous location ---
   at System.Net.Http.Functional.Tests.SocketsHttpHandler_HttpRequestErrorTest.<SecureConnectionError>d__3.MoveNext() + 0x5a
--- End of stack trace from previous location ---
--- End of stack trace from previous location ---
--- End of stack trace from previous location ---
----- Inner Stack Trace -----
   at System.Net.Test.Common.ActivityRecorder.<.ctor>b__36_2(Activity activity) + 0x4b
   at System.Diagnostics.SynchronizedList`1.EnumWithAction(Action`2, Object) + 0x31
   at System.Diagnostics.Activity.Start() + 0x146
   at System.Diagnostics.Activity.Create(ActivitySource, String, ActivityKind, String, ActivityContext, IEnumerable`1, IEnumerable`1, DateTimeOffset, ActivityTagsCollection, ActivitySamplingResult, Boolean, ActivityIdFormat, String) + 0x3a1
   at System.Diagnostics.ActivitySource.CreateActivity(String, ActivityKind, ActivityContext, String, IEnumerable`1, IEnumerable`1, DateTimeOffset, Boolean, ActivityIdFormat) + 0x6c0
   at System.Diagnostics.ActivitySource.StartActivity(String, ActivityKind) + 0x8a
   at System.Net.Http.DiagnosticsHandler.StartActivity(HttpRequestMessage) + 0x51
   at System.Net.Http.DiagnosticsHandler.<SendAsyncCore>d__9.MoveNext() + 0x101
--- End of stack trace from previous location ---
   at System.Net.Http.RedirectHandler.<SendAsync>d__4.MoveNext() + 0x1e8
--- End of stack trace from previous location ---
   at System.Net.Http.SocketsHttpHandler.<<SendAsync>g__CreateHandlerAndSendAsync|113_0>d.MoveNext() + 0x10b
--- End of stack trace from previous location ---
   at System.Net.Http.HttpClient.<<SendAsync>g__Core|83_0>d.MoveNext() + 0x399
--- End of stack trace from previous location ---

jkotas avatar Jun 03 '25 19:06 jkotas

Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.

Triage: let's monitor for a while and see if it happens again.

antonfirsov avatar Jun 09 '25 15:06 antonfirsov

The ErrorMessage seems to match different unrelated issues, but the failure in https://github.com/dotnet/runtime/issues/116279#issuecomment-2936959031 should be fixed by #116741.

antonfirsov avatar Jun 17 '25 13:06 antonfirsov

The ErrorMessage seems to match different unrelated issues

The failures are hit in different tests, but all of them have to do with ActivityRecorder.

I just saw a hit in this test: 

[FAIL] System.Net.Http.Functional.Tests.HttpMetricsTest_Http20_HttpMessageInvoker.ActiveRequests_Redirect_RecordedForEachHttpSpan(credentialsMode: 1)
Faulted: System.AggregateException: One or more errors occurred. (Assert.Same() Failure: Values are not the same instance
Expected: Activity { ActivityTraceFlags = None, Baggage = [], Context = System.Diagnostics.ActivityContext, DisplayName = "parent", Duration = 00:00:00, ··· }
Actual:   null)
 ---> Xunit.Sdk.SameException: Assert.Same() Failure: Values are not the same instance
Expected: Activity { ActivityTraceFlags = None, Baggage = [], Context = System.Diagnostics.ActivityContext, DisplayName = "parent", Duration = 00:00:00, ··· }
Actual:   null
   at Xunit.Assert.Same(Object, Object) + 0x60
   at System.Net.Test.Common.ActivityRecorder.<.ctor>b__36_2(Activity activity) + 0x50
   at System.Diagnostics.SynchronizedList`1.EnumWithAction(Action`2, Object) + 0x40
   at System.Diagnostics.Activity.Start() + 0x148

jkotas avatar Jun 22 '25 05:06 jkotas