]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/x509: reduce test's sought number of system certs
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 7 Dec 2016 16:18:51 +0000 (16:18 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 7 Dec 2016 17:09:37 +0000 (17:09 +0000)
150 is too high for some people.

Reports of 132, 145, 149 on OS X.

Fixes #18203

Change-Id: I559639aba7e87e07d1a1249f8b212b3f34a078ab
Reviewed-on: https://go-review.googlesource.com/34019
Reviewed-by: Russ Cox <rsc@golang.org>
src/crypto/x509/root_darwin_test.go

index c8ca3ead70034aa89cc6ba7c23351694a9cbab81..d6d8d07520e2ce2bc85e2aa83d11d77fd7e76b3e 100644 (file)
@@ -26,11 +26,14 @@ func TestSystemRoots(t *testing.T) {
                if tt == nil {
                        t.Fatal("no system roots")
                }
-               // On Mavericks, there are 212 bundled certs; require only
-               // 150 here, since this is just a sanity check, and the
-               // exact number will vary over time.
+               // On Mavericks, there are 212 bundled certs, at least
+               // there was at one point in time on one machine.
+               // (Maybe it was a corp laptop with extra certs?)
+               // Other OS X users report
+               // 135, 142, 145...  Let's try requiring at least 100,
+               // since this is just a sanity check.
                t.Logf("got %d roots", len(tt.certs))
-               if want, have := 150, len(tt.certs); have < want {
+               if want, have := 100, len(tt.certs); have < want {
                        t.Fatalf("want at least %d system roots, have %d", want, have)
                }
        }