Skip to content

[ci-fix] Needs review: Correct NTLM server test availability on iOS (refs #137733) - #137801

Merged
rzikm merged 1 commit into
mainfrom
ci-fix/137733-ntlm-ios-capability-36e8ec3-ed4496d06642e908
Nov 23, 2026
Merged

rzikm merged 1 commit into
mainfrom
ci-fix/137733-ntlm-ios-capability-36e8ec3-ed4496d06642e908

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Workflow artifact: ci-fix
Artifact kind: help
Linked KBE: #137733

Note

This is an AI/Copilot-generated best-effort fix attempt that could not be fully build-validated. It is a starting point for a maintainer, not a finished change. Please review the analysis below before merging.

Root cause (best analysis)

System.Net.Security.Tests.NegotiateAuthenticationTests.ServerPackage_Supported_NTLM expects ContinueNeeded for the initial NTLM server challenge, but the iOS simulator backend returns UnknownCredentials. The existing Unix capability probe already documents that Apple platforms advertise NTLM without providing the default NTLM acceptor credentials used by this test; it excludes macOS and MacCatalyst but omitted iOS.

The failing log assertion is:

Expected: ContinueNeeded
Actual:   UnknownCredentials

Attempted fix

Extend Capability.IsNtlmServerAvailable() to exclude iOS, matching the existing macOS and MacCatalyst capability correction. This preserves the test on platforms that can provide default NTLM acceptor credentials and prevents it from being treated as supported on iOS where the backend cannot satisfy the server-side exchange. The change only corrects capability detection; it does not alter product authentication behavior or weaken an assertion.

What is unverified / where I need help

  • The required baseline build was blocked by the runner permission gate before compilation could start.
  • The Unix capability path and iOS simulator test behavior should be validated on an Apple runner.
  • Please confirm that iOS and iOS Simulator should share the same NTLM server capability as macOS and MacCatalyst.

Validation

  • Command: ./build.sh clr+libs -rc release
  • Result: not run because runner permission approval blocked execution before the build started

Evidence

  • Failing build: 1682609
  • First build it occurred: 1672225 — 2026-11-10T12:00:18Z (computed within the scanned window; may not be the true origin)
  • Suspected regressing change: none identified with sufficient confidence

Help wanted

  • Likely author: none identified with sufficient confidence
  • Area owners (area-System.Net.Security): @karelz, @dotnet/ncl

Filed by ci-failure-fix, which attempts validated fixes for [ci-scan] Known Build Errors and otherwise loops in owners. Comment here or on the workflow file to suggest changes; ci-failure-scan-feedback reads in-scope feedback every two weeks and lists proposed prompt edits in its KPI tracker issue.

Structured data:

{
  "artifact_kind": "help",
  "linked_kbe": 137733,
  "workflow_artifact": "ci-fix"
}

Generated by CI Outer-Loop Failure Fixer · copilot · gpt56 · ~33 AIC · ⌖ ~2 AIC · ⊞ 31.3K · ◷

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@rzikm rzikm self-assigned this Nov 23, 2026
@rzikm
rzikm marked this pull request as ready for review November 23, 2026 09:45
@rzikm
rzikm merged commit 6f7daef into main Nov 23, 2026
62 of 64 checks passed
@rzikm
rzikm deleted the ci-fix/137733-ntlm-ios-capability-36e8ec3-ed4496d06642e908 branch November 23, 2026 09:45
@rzikm

rzikm commented Nov 23, 2026

Copy link
Copy Markdown
Member

/backport to release/11.0

@github-actions

Copy link
Copy Markdown
Contributor Author

Started backporting to release/11.0 (link to workflow run)

@rzikm

rzikm commented Nov 23, 2026

Copy link
Copy Markdown
Member

/backport to release/10.0

@github-actions

Copy link
Copy Markdown
Contributor Author

Started backporting to release/10.0 (link to workflow run)

@github-actions

Copy link
Copy Markdown
Contributor Author

@rzikm backporting to release/11.0 failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git cherry-pick 6f7daefe9a37c7cd1bbd99ee565f9414986d87c3

Auto-merging src/libraries/Common/tests/System/Net/Capability.Security.Unix.cs
CONFLICT (content): Merge conflict in src/libraries/Common/tests/System/Net/Capability.Security.Unix.cs
error: could not apply 6f7daefe9a3... [ci-fix] Needs review: Correct NTLM server test availability on iOS (refs #137733) (#137801)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"


$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Fix NTLM server test availability on iOS
Using index info to reconstruct a base tree...
M	src/libraries/Common/tests/System/Net/Capability.Security.Unix.cs
Falling back to patching base and 3-way merge...
Auto-merging src/libraries/Common/tests/System/Net/Capability.Security.Unix.cs
CONFLICT (content): Merge conflict in src/libraries/Common/tests/System/Net/Capability.Security.Unix.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Fix NTLM server test availability on iOS
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

@github-actions

Copy link
Copy Markdown
Contributor Author

@rzikm backporting to release/10.0 failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git cherry-pick 6f7daefe9a37c7cd1bbd99ee565f9414986d87c3

Auto-merging src/libraries/Common/tests/System/Net/Capability.Security.Unix.cs
CONFLICT (content): Merge conflict in src/libraries/Common/tests/System/Net/Capability.Security.Unix.cs
error: could not apply 6f7daefe9a3... [ci-fix] Needs review: Correct NTLM server test availability on iOS (refs #137733) (#137801)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"


$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Fix NTLM server test availability on iOS
Using index info to reconstruct a base tree...
M	src/libraries/Common/tests/System/Net/Capability.Security.Unix.cs
Falling back to patching base and 3-way merge...
Auto-merging src/libraries/Common/tests/System/Net/Capability.Security.Unix.cs
CONFLICT (content): Merge conflict in src/libraries/Common/tests/System/Net/Capability.Security.Unix.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Fix NTLM server test availability on iOS
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 24, 2026
lewing pushed a commit that referenced this pull request Nov 24, 2026
Fixes Issue <!-- Issue Number --> N/A (test-applicability backport;
related issue #137733 is not closed by this PR).

main PR <!-- Link to PR if any that fixed this in the main branch. -->
#137801

# Description

<!-- Give a brief summary of the issue and how the pull request is
fixing it. -->

Backport merged main commit 6f7daef.
Apple GSS advertises NTLM but cannot supply the default NTLM acceptor
credentials used by these server tests, resulting in
`UnknownCredentials` instead of `ContinueNeeded` for `Negotiate`,
`NTLM`, and `nTlM`.

Exclude iOS from `Capability.IsNtlmServerAvailable()` and use the
upstream Apple-platform comment. This corrects test applicability only;
product behavior and assertions are unchanged.

**Branch adaptation:** release/10.0 predates the MacCatalyst correction
in #137410. Its
`OperatingSystem.IsIOS()` explicitly includes MacCatalyst
(`System.Private.CoreLib/src/System/OperatingSystem.cs`), so the single
new guard covers both iOS and MacCatalyst without a redundant separate
guard. This is an adapted backport, not an exact cherry-pick.

# Customer Impact

<!-- What is the impact to customers of not taking this fix? -->

No product behavior change. Without this correction, affected Apple test
runs report failures for an unsupported default-credential NTLM server
scenario, adding CI noise and obscuring real regressions.

# Regression

<!-- Is this fixing a problem that was introduced in the most recent
release, ie., fixing a regression? -->

Test capability-detection correction, not a product regression fix. The
release branch already contains the NTLM server capability helper and
its unit/functional test consumers, but excludes only macOS.

# Testing

<!-- What kind of testing has been done with the fix. -->

Validated on Windows x64 using an isolated checkout mapped to `T:` and
SDK 10.0.115 (matching `global.json`). Heavy builds/tests were
serialized with the shared build mutex.

- `T:\build.cmd clr+libs -rc release`: **failed before changes**,
because the SDK's Git task does not support the shared repository's
`relativeworktrees` extension (`src/native/corehost/corehost.proj`). No
shared Git metadata was modified.
- `T:\build.cmd clr+libs -rc release
/p:EnableSourceControlManagerQueries=false`: **passed**, 0 warnings, 0
errors. The supported per-invocation source-control-query opt-out avoids
that local SDK tooling incompatibility.
- From `T:\`, `T:\dotnet.cmd build
src\libraries\System.Net.Security\tests\UnitTests\System.Net.Security.Unit.Tests.csproj
/t:Test /p:RuntimeConfiguration=Release
/p:EnableSourceControlManagerQueries=false`: **passed**, 101 total, 100
passed, 1 skipped, 0 failed/errors. XML confirms
`ServerPackage_Supported_NTLM` passed for all three inputs. **Windows
uses the separate Windows capability helper; this is control coverage,
not execution of the changed Unix helper.**
- `T:\dotnet.cmd run --project
C:\Users\radekzikmund\.copilot\session-state\5eacbfe2-7004-42e4-bc10-70c972f1707f\files\capability-probe\CapabilityProbe.csproj`:
**passed**, 10/10 source-linked Unix-helper cases with simulated
OS/native inputs. Before the fix, the same probe failed the iOS device,
iOS simulator, and MacCatalyst cases (3/10 failures). After the fix, all
three return false without native calls; macOS/browser/WASI exclusions
and Linux/native-library controls remain unchanged. The probe is a local
validation artifact, not a committed test or an Apple runtime run.
- `git diff --check`: **passed**.

**Platform limitation:** actual iOS device/simulator and MacCatalyst
execution was not run; an Apple runner is unavailable locally. No claim
is made that simulation validates native Apple authentication behavior.

# Risk

<!-- Please assess the risk of taking this fix. Provide details backing
up your assessment. -->

Low: one test-only capability guard and comment update. Existing
assertions are preserved, supported non-Apple platforms retain coverage,
and no shipping product code changes. The intentional effect is to stop
scheduling tests requiring unavailable default NTLM acceptor credentials
on iOS and MacCatalyst. Actual Apple execution remains for CI.

> [!NOTE]
> This backport and pull request description were prepared with GitHub
Copilot.

# Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet
package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older
versions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
lewing pushed a commit that referenced this pull request Nov 24, 2026
Fixes Issue <!-- Issue Number --> N/A. Related tracking issue: #137733;
this test-only backport does not close it.

main PR <!-- Link to PR if any that fixed this in the main branch. -->
#137801

# Description

<!-- Give a brief summary of the issue and how the pull request is
fixing it. -->

Adapted backport of #137801 (6f7daef):
exclude iOS from `Capability.IsNtlmServerAvailable()`. Apple GSS
advertises NTLM but does not provide the default NTLM acceptor
credentials needed by these server tests, resulting in
`UnknownCredentials` instead of `ContinueNeeded`.

`release/11.0` also lacks the earlier MacCatalyst correction (#137410).
`OperatingSystem.IsIOS()` returns true for both iOS and MacCatalyst, so
this minimal backport covers both without adding a redundant
`IsMacCatalyst()` check. The comment matches the upstream Apple-platform
wording. No product code or assertions change.

# Customer Impact

<!-- What is the impact to customers of not taking this fix? -->

No product behavior change. Without the correction, release-branch Apple
test runs can report authentication failures for a server capability the
platform cannot provide, reducing CI signal.

# Regression

<!-- Is this fixing a problem that was introduced in the most recent
release, ie., fixing a regression? -->

Test applicability correction, not a product regression fix. The release
branch's shared helper excludes macOS but incorrectly reports iOS and
MacCatalyst NTLM server availability.

# Testing

<!-- What kind of testing has been done with the fix. -->

Validation performed on Windows using a short `subst` path to this
checkout:

- `V:\build.cmd clr+libs -rc release` — clean baseline passed, 0
warnings and 0 errors.
- From the checkout root: `.\dotnet.cmd build
src\libraries\System.Net.Security\tests\UnitTests\System.Net.Security.Unit.Tests.csproj
/t:Test /p:RuntimeConfiguration=Release` — passed; 124 total, 120
passed, 4 skipped, 0 failed. All three `ServerPackage_Supported_NTLM`
inputs (`Negotiate`, `NTLM`, `nTlM`) passed. This uses the Windows
helper, not the modified Unix helper.
- From a scratch source-linked capability-probe project: `dotnet run
--project CapabilityProbe.csproj` — before the fix, failed exactly the
iOS-device, iOS-simulator and MacCatalyst cases (3 failures out of 10);
after the fix, all 10 cases passed. The project compiles this checkout's
actual Unix helper with simulated OS/native inputs and checks capability
results and native-call counts for iOS, MacCatalyst, macOS, Linux,
browser, WASI and missing-library behavior. This is a simulation, not
Apple runtime validation.
- `git diff --check` — passed before commit.

Apple device/simulator and MacCatalyst execution were not available
locally and have not been performed. No claim is made that Windows tests
validate Apple GSS behavior.

# Risk

<!-- Please assess the risk of taking this fix. Provide details backing
up your assessment. -->

Low: one shared test helper and its comment change. Unsupported Apple
NTLM-server tests are no longer selected; client capability detection,
product authentication behavior, assertions, and non-Apple capability
logic remain unchanged. No public API or breaking-change documentation
is involved.

# Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet
package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older
versions.

> [!NOTE]
> This backport and PR description were prepared with GitHub Copilot.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant