[release/8.0-staging] Make TestKeyRing.CreateECDsa resilient to transient macOS OSStatus -50 failures - #134461
Merged
ViveliDuCh merged 1 commit intoSep 23, 2026
Conversation
…0 failures Backport of dotnet#125909 to release/8.0-staging. The automated backport failed because TestKeyRing.cs (introduced by a later refactor) does not exist on this branch; the CreateECDsa helper still lives in CoseTestHelpers.cs here. This applies the same fix (retry ECDsa.Create up to 3 times on macOS when it transiently fails with OSStatus -50 / CryptographicException HResult -50) to that location instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The scoped test-only change has no unresolved blocking issues.
Review effort: Lite
Findings: None
What changed in this PR
This pull request backports a test-only fix that makes COSE ECDSA key creation resilient to transient macOS failures.
Changes:
- Retries matching macOS cryptographic failures up to three times.
- Uses
RuntimeInformationfor compatibility.
| File | Description |
|---|---|
src/libraries/System.Security.Cryptography.Cose/tests/CoseTestHelpers.cs |
Adds bounded retry handling for ECDSA creation. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
This was referenced Sep 23, 2026
jozkee
approved these changes
Sep 23, 2026
Member
Author
|
/ba-g deadletter |
Member
Author
|
Test only change. Adding servicing-approved. |
ViveliDuCh
merged commit Sep 23, 2026
991b913
into
dotnet:release/8.0-staging
119 of 127 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #125909 to release/8.0-staging
/cc @ViveliDuCh
Customer Impact
Sporadic CI test failures across the
System.Security.Cryptography.Cose.Testssuite on macOS, caused by the Apple Security framework intermittently returningOSStatus error -50 ("Unsupported key type: 73")when importing EC keys used by shared test fixtures. This is a test-only reliability fix; it does not affect shipped product behavior.Regression
Not a product regression; it's a flaky-test fix already merged to
main(#125909, itself fixing #121902) and torelease/10.0(#132252).Testing
Verified by inspection against the merged
mainfix. The automated backport bot failed to cherry-pick #125909 becauseTestKeyRing.cs(introduced by a later refactor) doesn't exist onrelease/8.0-staging; theCreateECDsahelper this PR needs to fix still lives inCoseTestHelpers.cshere. This PR applies the identical retry logic to that location.Risk
Low. Test only change.
IMPORTANT: If this backport is for a servicing release, please verify that:
release/X.0-staging, notrelease/X.0.release/X.0(no-stagingsuffix).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.