Repository navigation
Description
Flaky Test Report (automated)
Test: MonoTests.System.Net.Http.MessageHandlerTest.AcceptSslCertificatesServicePointManager(System.Net.Http.HttpClientHandler)
Platform: macOS (Debug, static registrar)
Category: Flaky (external network dependency)
Period: June 29β30, 2026
Occurrence Summary
| PR | Build | Configuration | Bot | Attempt | Direct Link |
|---|---|---|---|---|---|
| #25858 | 14517509 | monotouch-test/macOS/Debug (static registrar) | AcesShared 90 | 1 | Run tests |
| #25858 | 14517509 | monotouch-test/macOS/Debug (static registrar) | AcesShared 8 | 2 | Run tests (attempt 2) |
Total: Failed consistently on both attempts (different bots), confirming it's not bot-specific.
Error Details
MonoTests.System.Net.Http.MessageHandlerTest.AcceptSslCertificatesServicePointManager(System.Net.Http.HttpClientHandler):
Assert.That(ex, Is.Null)
Expected: null
But was: <System.Net.Http.HttpRequestException: Error while copying content to a stream.
---> System.Net.Http.HttpIOException: The response ended prematurely. (ResponseEnded)
at System.Net.Http.HttpConnection.FillAsync(Boolean async)
at System.Net.Http.HttpConnection.CopyToContentLengthAsync(...)
at System.Net.Http.HttpConnection.ContentLengthReadStream.CompleteCopyToAsync(...)
at System.Net.Http.HttpConnectionResponseContent.<SerializeToStreamAsync>g__Impl|6_0(...)
at System.Net.Http.HttpContent.LoadIntoBufferAsyncCore(...)
Root Cause Analysis
The test makes HTTP requests to httpbin.org (an external service) using HttpClientHandler:
- Calls
httpbin.org/redirect/3(follows 3 redirects) - The external server drops the TCP connection mid-response
HttpIOException: The response ended prematurely (ResponseEnded)is thrown
Why it's not caught as inconclusive:
The test calls TestRuntime.IgnoreInCIIfBadNetwork(ex) (tests/common/TestRuntime.cs:1618), which handles:
- HTTP status codes (502, 504, 503)
- Network connection lost (SocketException)
- DNS resolution failures
- Timeouts
But it does NOT handle HttpIOException / "response ended prematurely". This is a gap β premature response termination is clearly a network issue that should mark the test Inconclusive in CI.
Suggested Fix
Add a check for HttpIOException in IgnoreInCIIfBadNetwork:
// In TestRuntime.cs, add to IgnoreInCIIfBadNetwork(Exception? ex):
IgnoreInCIIfResponseEndedPrematurely (ex);
// New helper:
public static void IgnoreInCIIfResponseEndedPrematurely (Exception ex)
{
var httpIoEx = FindInner<System.Net.Http.HttpIOException> (ex);
if (httpIoEx is null)
return;
if (!IsRunningOnCI)
return;
Assert.Inconclusive ($"Ignoring network issue in CI: {httpIoEx.Message}");
}Related Issues
- [CI Postmortem] Flaky tests confirmed by rerun: network/TLS tests on macOSΒ #25225 (Closed) β Flaky network/TLS tests on macOS (same test class, different methods)
- [CI Postmortem] Flaky: MonoTests.System.Net.Http.MessageHandlerTest.TestNSUrlSessionHandlerSendClientCertificateΒ #25240 (Closed) β Flaky
TestNSUrlSessionHandlerSendClientCertificate
Classification
This failure is unrelated to PR #25858 (which improves macOS test runner diagnostic output). It's caused by the external dependency on httpbin.org, which intermittently drops TCP connections.
This issue was automatically generated by CI post-mortem analysis.
Activity
[tests] Mark tests inconclusive on premature response termination. Fixes
rolfbjarne commentedon Jul 6, 2026
CI Post-Mortem Update (2026-06-30 β 2026-07-06)
This flaky test recurred after the fix (#25875) was merged to
mainon 2026-07-01:All three occurrences were on
monotouch_macoswith the same premature-connection-close error (net_http_content_stream_copy_errorβnet_http_invalid_response_prematurely).Not reopening, because none of these recurrences invalidate the fix:
xcode27.0) and 14550254 ([net11.0] Update dependencies from dotnet/dotnetΒ #25907,net11.0) are on branches that had not yet received the fix frommainat the time they ran.No post-fix recurrence was observed on a
main-based build. This should resolve on the affected branches oncemainis merged forward intoxcode27.0andnet11.0.Automated CI post-mortem analysis.