From 498985b6dc1b1f6348d5584b8fa9737dd36e9d18 Mon Sep 17 00:00:00 2001 From: Jeremy Barton Date: Wed, 5 Jun 2019 07:48:22 -0700 Subject: [PATCH] Reenable BuildInvalidSignatureTwice with better diagnostics Commit migrated from https://github.com/dotnet/corefx/commit/09c3160b52e1e47b3a92c837337672d1b426e170 --- .../tests/ChainTests.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs index 3b61c25..983958a 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs @@ -856,7 +856,6 @@ tHP28fj0LUop/QFojSZPsaPAW6JvoQ0t4hd6WoyX6z7FsA== } } - [ActiveIssue(36124, TestPlatforms.Windows)] [Fact] public static void BuildInvalidSignatureTwice() { @@ -896,9 +895,9 @@ tHP28fj0LUop/QFojSZPsaPAW6JvoQ0t4hd6WoyX6z7FsA== } else { - Assert.False(valid, $"Chain is valid on execution {iter}"); - - Assert.Equal(3, chain.ChainElements.Count); + // These asserts are "most informative first". + // (There was an interval where valid was reporting as true in CI, but + // that is the least informative failure) // Clear UntrustedRoot, if it happened. allFlags &= ~X509ChainStatusFlags.UntrustedRoot; @@ -906,6 +905,10 @@ tHP28fj0LUop/QFojSZPsaPAW6JvoQ0t4hd6WoyX6z7FsA== Assert.Equal( X509ChainStatusFlags.NotSignatureValid, allFlags); + + Assert.Equal(3, chain.ChainElements.Count); + + Assert.False(valid, $"Chain is valid on execution {iter}"); } chainHolder.DisposeChainElements(); -- 2.7.4