Skip to content

[CI] Flaky: SecProtocolMetadataTest.TlsDefaults — ServerName is null #25877

Description

@rolfbjarne

Flaky Test Report (automated)

Test: MonoTouchFixtures.Security.SecProtocolMetadataTest.TlsDefaults
Platform: iOS (simulator, Debug LinkSdk)
Category: Flaky (network dependency)
Period: June 30, 2026

Occurrence Summary

PR Build Configuration Bot Direct Link
#25837 14527953 monotouch-test/iOS - simulator/Debug (LinkSdk) AcesShared 71 Run tests

Error Details

MonoTouchFixtures.Security.SecProtocolMetadataTest.TlsDefaults:
  ServerName
  Assert.That(s.ServerName, Is.EqualTo("www.microsoft.com"))
    Expected: "www.microsoft.com"
    But was:  null

  at MonoTouchFixtures.Security.SecProtocolMetadataTest.TlsDefaults()
    in tests/monotouch-test/Security/SecProtocolMetadataTest.cs:line 84

Analysis

The test:

  1. Opens an NWConnection to www.microsoft.com:443 using NWParameters.CreateSecureTcp()
  2. Waits up to 10 seconds for the connection to reach "Ready" state
  3. Gets NWTlsMetadataSecProtocolMetadata
  4. Asserts that SecProtocolMetadata.ServerName == "www.microsoft.com"

The connection reached "Ready" state (otherwise Assert.Fail("Connection is ready") would have fired), but the TLS metadata's ServerName property returned null.

Possible causes:

  • Corporate proxy or network appliance stripping SNI (Server Name Indication) from the TLS handshake
  • Network condition where the TLS negotiation succeeds but the metadata doesn't capture the server name (timing/race in metadata retrieval)
  • Change in the www.microsoft.com server's TLS configuration or CDN behavior

Note: The test has some network failure handling (ignores in CI if no callbacks are received), but does NOT handle the case where the connection succeeds but metadata is incomplete.

Suggested Fix

Add a null-check with Assert.Inconclusive for ServerName when running in CI, since it depends on network/TLS negotiation details that can vary:

if (TestRuntime.CheckXcodeVersion (11, 0)) {
    // ... existing tests ...
    if (s.ServerName is null)
        TestRuntime.IgnoreInCI ("ServerName is null - likely network proxy interference");
    Assert.That (s.ServerName, Is.EqualTo ("www.microsoft.com"), "ServerName");
}

Classification

This failure is unrelated to PR #25837 (which changes sharpie's nullability emission for block/delegate parameters). It's a network-dependent test that can fail when the TLS metadata doesn't reflect the expected server name.


This issue was automatically generated by CI post-mortem analysis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIf an issue is a bug or a pull request a bug fixci-failureThe issue only affects CIci-postmortemCI post-mortem analysis: flaky tests, infrastructure failures, shared regressionscopilot

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions