Skip to content

[ci-scan] Test failure: Microsoft.Extensions.Hosting.Tests.HostTests.CreateDefaultBuilder_RegistersEventSourceLogger on Apple Na [Content truncated due to length] #130254

Closed

Description

@github-actions

Build Information

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1494308
Build error leg or test failing: iossimulator-arm64 Release AllSubsets_NativeAOT - Microsoft.Extensions.Hosting.Unit.Tests

Error Details

On the Apple NativeAOT library-test legs (iossimulator / maccatalyst AllSubsets_NativeAOT), HostTests.CreateDefaultBuilder_RegistersEventSourceLogger fails its Assert.Contains check: the expected EventSourceLogger provider is not present among the registered logging providers under NativeAOT.

[FAIL] Microsoft.Extensions.Hosting.Tests.HostTests.CreateDefaultBuilder_RegistersEventSourceLogger
Assert.Contains() Failure: Filter not matched in collection

The harness runs and this individual test fails, so it is distinct from the harness-startup crash tracked by #130219 (mono_ios_set_summary MarshalDirectiveException on the tvos device leg). NativeAOT library tests on Apple mobile were newly enabled by #125437 (merged 2026-07-02).

Observed on source build 1494308 (State=Failed) and again on follow-up build 1494829; reproduces across the iossimulator and maccatalyst NativeAOT legs.

Related: #130219

Error Message

{
  "ErrorMessage": [
    "[FAIL] Microsoft.Extensions.Hosting.Tests.HostTests.CreateDefaultBuilder_RegistersEventSourceLogger",
    "Assert.Contains() Failure: Filter not matched in collection"
  ],
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • dotnet.github.io

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "dotnet.github.io"

See Network Configuration for more information.

Note

🔒 Integrity filter blocked 28 items

The following items were blocked because they don't meet the GitHub integrity level.

  • #5158 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #5984 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #7096 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #5318 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #44158 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #5101 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #129876 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #88361 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #129876 issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #130227 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #130105 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #129960 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #129959 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #70306 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #126819 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #123929 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • ... and 12 more items

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
  github:
    min-integrity: approved  # merged | approved | unapproved | none

Generated by CI Outer-Loop Failure Scanner · ● 14.3M · ◷

Report

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 0

Activity

  1. added
    blocking-clean-ci
    Known Build Error
    on Jul 6, 2026
  2. added
    untriaged
    on Jul 6, 2026
  3. dotnet-policy-service commented on Jul 7, 2026

    @dotnet-policy-service
    Contributor

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

  4. github-actions commented on Jul 8, 2026

    @github-actions
    ContributorAuthor

    Workflow artifact: ci-fix
    Artifact kind: handoff
    Linked KBE: #130254

    Note

    AI/Copilot-generated root-cause hand-off (ci-failure-fix). No automated code change was produced because the only in-bounds change would be to weaken or skip the assertion under NativeAOT, which this workflow must not do. Looping in owners to fix forward.

    Root cause (read-only analysis)

    On the Apple NativeAOT library-test legs (iossimulator / maccatalyst AllSubsets_NativeAOT, build 1494308), Microsoft.Extensions.Hosting.Tests.HostTests.CreateDefaultBuilder_RegistersEventSourceLogger fails:

    Assert.Contains() Failure: Filter not matched in collection
    

    The test builds a default host, logs "Request starting", then asserts the Microsoft-Extensions-Logging EventSource emitted an event whose payload contains that string (HostTests.cs:164-177):

    logger.LogInformation("Request starting");
    var events = listener.EventData.ToArray();
    Assert.Contains(events, args =>
        args.EventSource.Name == "Microsoft-Extensions-Logging" &&
        args.Payload.OfType<string>().Any(p => p.Contains("Request starting")));

    The provider is registered — Host.CreateDefaultBuilder calls logging.AddEventSourceLogger() unconditionally (HostingHostBuilderExtensions.cs:311). The gap is at event emission: LoggingEventSource writes log messages via EventSource's self-describing / reflection-based path (note the numerous [UnconditionalSuppressMessage("...IL2026:RequiresUnreferencedCode...")] on its members in LoggingEventSource.cs). Under Apple NativeAOT that reflection-based emission does not surface the payload to the EventListener, so no matching event is captured and the Assert.Contains fails.

    This is an EventSource-under-NativeAOT runtime behavior, not a registration bug. The only in-bounds change would be to gate or skip the assertion under NativeAOT — that is muting, which this workflow does not do — so I am handing off instead.

    Evidence

    • Failing build: 1494308 (also follow-up 1494829); reproduces on iossimulator and maccatalyst NativeAOT legs.
    • Test: src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostTests.cs:164.
    • Registration: src/libraries/Microsoft.Extensions.Hosting/src/HostingHostBuilderExtensions.cs:311.
    • Emission path: src/libraries/Microsoft.Extensions.Logging.EventSource/src/LoggingEventSource.cs.
    • These NativeAOT library tests on Apple mobile were newly enabled by [mobile] Enable NativeAOT library tests on Apple mobile platforms #125437.

    Suggested reviewers / area contacts

    Note

    🔒 Integrity filter blocked 17 items

    The following items were blocked because they don't meet the GitHub integrity level.

    • #128501 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
    • #104998 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
    • #104750 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
    • #97491 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
    • #76276 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
    • #78999 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
    • #76417 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
    • #69571 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
    • #62435 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
    • #61444 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
    • #35376 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
    • #193 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
    • #34218 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
    • #38914 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
    • #44747 search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
    • [ci-scan] Test failure: System.Threading.Tests.MutexTests.CrossProcess_NamedMutex_ConcurrentCreateOrOpen #130125 issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
    • ... and 1 more item

    To allow these resources, lower min-integrity in your GitHub frontmatter:

    tools:
      github:
        min-integrity: approved  # merged | approved | unapproved | none

    Generated by CI Outer-Loop Failure Fixer · ● 9.3M · ◷

  5. removed
    untriaged
    on Jul 16, 2026
  6. added this to the Future milestone on Jul 16, 2026
  7. removed
    blocking-clean-ci
    on Aug 10, 2026
  8. locked and limited conversation to collaborators on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Known Build Erroragentic-workflowsarea-Extensions-Hosting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions