Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 97c62af

Browse files
bartonjsstephentoub
authored andcommitted
Make VerifyWithRevocation skip if the Online chain can't build (#21269)
When the system doesn't have a current CRL cached for the entirety of the chain, and the CRL Distribution Point is offline (or there's a local network issue) then the test fails. This is tolerable for a manual run, but not for the automated runs. So unless the X.509 "RunManualTests" configuration is set, treat a failure of the online chain to be a skip. Ideally we'd throw a SkipTestException, or something of that ilk, but xunit doesn't support it.
1 parent fba6a22 commit 97c62af

File tree

1 file changed

+8
-1
lines changed
  • src/System.Security.Cryptography.X509Certificates/tests

1 file changed

+8
-1
lines changed

src/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,14 @@ public static void VerifyWithRevocation()
571571
}
572572
}
573573

574-
Assert.True(valid, $"Online Chain Built Validly within {RetryLimit} tries");
574+
if (TestEnvironmentConfiguration.RunManualTests)
575+
{
576+
Assert.True(valid, $"Online Chain Built Validly within {RetryLimit} tries");
577+
}
578+
else if (!valid)
579+
{
580+
Console.WriteLine($"SKIP [{nameof(VerifyWithRevocation)}]: Chain failed to build within {RetryLimit} tries.");
581+
}
575582

576583
// Since the network was enabled, we should get the whole chain.
577584
Assert.Equal(3, onlineChain.ChainElements.Count);

0 commit comments

Comments
 (0)