[Android] Remove unnecessary X509Chain memory leak test#128493
Merged
jkotas merged 2 commits intoMay 22, 2026
Merged
Conversation
4 tasks
Contributor
|
Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security |
steveisok
approved these changes
May 22, 2026
jkotas
approved these changes
May 22, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes an Android-specific long-running X509Chain unit test from the System.Security.Cryptography test suite.
Changes:
- Deleted the Android-only stress test
BuildChainRepeatedly_DoesNotExhaustGlobalReferences(including its helper local function) fromChainTests.cs.
Comments suppressed due to low confidence (2)
src/libraries/System.Security.Cryptography/tests/X509Certificates/ChainTests.cs:382
- Removing this method eliminates the only explicit Android regression coverage for the JNI global-ref leak scenario (no other references found in the tests). If the goal is to drop a 10-minute local stress test, consider replacing it with a CI-runnable check (or relocating it to an explicit stress/outerloop suite) so the original Android GREF overflow regression can’t silently reappear.
[Fact]
public static void BuildChainWithSystemTrustAndCustomTrustCertificates()
{
using (var testCert = new X509Certificate2(TestFiles.ChainPfxFile, TestData.ChainPfxPassword))
src/libraries/System.Security.Cryptography/tests/X509Certificates/ChainTests.cs:382
- After removing the Android stress test, the
using System.Security.Cryptography.X509Certificates.Tests.Common;directive at the top of this file no longer appears to be referenced (noCertificateAuthority/PkiOptions/RevocationResponderusages remain). WithTreatWarningsAsErrorsenabled repo-wide, this will likely fail the build due to CS8019 unless the using is removed or the remaining usages are reintroduced.
[Fact]
public static void BuildChainWithSystemTrustAndCustomTrustCertificates()
{
using (var testCert = new X509Certificate2(TestFiles.ChainPfxFile, TestData.ChainPfxPassword))
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.
Follow-up to #128284
Follow-up to #128385
This PR removes an unnecessary long running unit test added in #128284
/cc @jkotas