{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/2583","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/2583/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/2583/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/2583/events","html_url":"https://github.com/dotnet/corefx/issues/2583","id":98449012,"number":2583,"title":"Intermittent X509 test failure","user":{"login":"nguerrera","id":75470,"avatar_url":"https://avatars.githubusercontent.com/u/75470?v=3","gravatar_id":"","url":"https://api.github.com/users/nguerrera","html_url":"https://github.com/nguerrera","followers_url":"https://api.github.com/users/nguerrera/followers","following_url":"https://api.github.com/users/nguerrera/following{/other_user}","gists_url":"https://api.github.com/users/nguerrera/gists{/gist_id}","starred_url":"https://api.github.com/users/nguerrera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nguerrera/subscriptions","organizations_url":"https://api.github.com/users/nguerrera/orgs","repos_url":"https://api.github.com/users/nguerrera/repos","events_url":"https://api.github.com/users/nguerrera/events{/privacy}","received_events_url":"https://api.github.com/users/nguerrera/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"bartonjs","id":10642668,"avatar_url":"https://avatars.githubusercontent.com/u/10642668?v=3","gravatar_id":"","url":"https://api.github.com/users/bartonjs","html_url":"https://github.com/bartonjs","followers_url":"https://api.github.com/users/bartonjs/followers","following_url":"https://api.github.com/users/bartonjs/following{/other_user}","gists_url":"https://api.github.com/users/bartonjs/gists{/gist_id}","starred_url":"https://api.github.com/users/bartonjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartonjs/subscriptions","organizations_url":"https://api.github.com/users/bartonjs/orgs","repos_url":"https://api.github.com/users/bartonjs/repos","events_url":"https://api.github.com/users/bartonjs/events{/privacy}","received_events_url":"https://api.github.com/users/bartonjs/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2015-07-31T18:47:19Z","updated_at":"2015-08-24T21:38:00Z","closed_at":null,"body":"I can't repro it, but I got the following once:\r\n\r\n```\r\n System.Security.Cryptography.X509Certificates.Tests.PfxTests.TestPrivateKey [FAIL]\r\n               System.Security.Cryptography.CryptographicException : OpenCSP failed with error code 2148073494.\r\n               Stack Trace:                  D:\\Src\\corefx\\src\\System.Security.Cryptography.Csp\\src\\System\\Security\\Cryptography\\CapiHelper.cs(306,0): at Internal.NativeCrypto.CapiHelper.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)\r\n                  D:\\Src\\corefx\\src\\System.Security.Cryptography.Csp\\src\\System\\Security\\Cryptography\\CapiHelper.cs(698,0): at Internal.NativeCrypto.CapiHelper.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 keySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle)\r\n                  D:\\Src\\corefx\\src\\System.Security.Cryptography.Csp\\src\\System\\Security\\Cryptography\\RSACryptoServiceProvider.cs(89,0): at System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair()\r\n                  D:\\Src\\corefx\\src\\System.Security.Cryptography.Csp\\src\\System\\Security\\Cryptography\\RSACryptoServiceProvider.cs(69,0): at System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 keySize, CspParameters parameters, Boolean useDefaultKeySize)\r\n                  D:\\Src\\corefx\\src\\System.Security.Cryptography.Csp\\src\\System\\Security\\Cryptography\\RSACryptoServiceProvider.cs(50,0): at System.Security.Cryptography.RSACryptoServiceProvider..ctor(CspParameters parameters)\r\n                  D:\\Src\\corefx\\src\\System.Security.Cryptography.X509Certificates\\src\\Internal\\Cryptography\\Pal.Windows\\CertificatePal.PrivateKey.cs(49,0): at Internal.Cryptography.Pal.CertificatePal.get_PrivateKey()\r\n                  D:\\Src\\corefx\\src\\System.Security.Cryptography.X509Certificates\\src\\System\\Security\\Cryptography\\X509Certificates\\RSACertificateExtensions.cs(55,0): at System.Security.Cryptography.X509Certificates.RSACertificateExtensions.GetRSAPrivateKey(X509Certificate2 certificate)\r\n                  D:\\Src\\corefx\\src\\System.Security.Cryptography.X509Certificates\\tests\\PfxTests.cs(70,0): at System.Security.Cryptography.X509Certificates.Tests.PfxTests.TestPrivateKey()\r\n         Finished:    System.Security.Cryptography.X509Certificates.Tests\r\n         \r\n         === TEST EXECUTION SUMMARY ===\r\n            System.Security.Cryptography.X509Certificates.Tests  Total: 157, Errors: 0, Failed: 1, Skipped: 0, Time: 0.854s\r\n```"},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/134388106","html_url":"https://github.com/dotnet/corefx/issues/2583#issuecomment-134388106","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/2583","id":134388106,"user":{"login":"bartonjs","id":10642668,"avatar_url":"https://avatars.githubusercontent.com/u/10642668?v=3","gravatar_id":"","url":"https://api.github.com/users/bartonjs","html_url":"https://github.com/bartonjs","followers_url":"https://api.github.com/users/bartonjs/followers","following_url":"https://api.github.com/users/bartonjs/following{/other_user}","gists_url":"https://api.github.com/users/bartonjs/gists{/gist_id}","starred_url":"https://api.github.com/users/bartonjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartonjs/subscriptions","organizations_url":"https://api.github.com/users/bartonjs/orgs","repos_url":"https://api.github.com/users/bartonjs/repos","events_url":"https://api.github.com/users/bartonjs/events{/privacy}","received_events_url":"https://api.github.com/users/bartonjs/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T21:38:00Z","updated_at":"2015-08-24T21:38:00Z","body":"The answer might be to use a [collection fixture](http://xunit.github.io/docs/shared-context.html#collection-fixture) to ensure that the PFX data blobs are being limited to one concurrent method, since each method causes the keyfile to be written and deleted."}}