{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/94269175","pull_request_review_id":14800117,"id":94269175,"diff_hunk":"@@ -40,6 +38,17 @@ private static bool GetCachedSwitchValueInternal(string switchName, ref int swit\n             return isSwitchEnabled;\n         }\n \n+        private static void InitDisableCaching()\n+        {\n+            bool isEnabled;\n+            if (AppContext.TryGetSwitch(@\"TestSwitch.LocalAppContext.DisableCaching\", out isEnabled))","path":"src/Common/src/System/LocalAppContext.cs","position":32,"original_position":32,"commit_id":"0e20e48ea063eba8b306bbf65313a72d161b56d2","original_commit_id":"0e20e48ea063eba8b306bbf65313a72d161b56d2","user":{"login":"AlexGhiondea","id":8396979,"avatar_url":"https://avatars.githubusercontent.com/u/8396979?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexGhiondea","html_url":"https://github.com/AlexGhiondea","followers_url":"https://api.github.com/users/AlexGhiondea/followers","following_url":"https://api.github.com/users/AlexGhiondea/following{/other_user}","gists_url":"https://api.github.com/users/AlexGhiondea/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexGhiondea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexGhiondea/subscriptions","organizations_url":"https://api.github.com/users/AlexGhiondea/orgs","repos_url":"https://api.github.com/users/AlexGhiondea/repos","events_url":"https://api.github.com/users/AlexGhiondea/events{/privacy}","received_events_url":"https://api.github.com/users/AlexGhiondea/received_events","type":"User","site_admin":false},"body":"If you do that, then you don't have to introduce an extra check in the `GetCachedSwitchValueInternal` method as it will become part of the `DisableCaching` check. ","created_at":"2016-12-31T05:00:07Z","updated_at":"2016-12-31T05:07:21Z","html_url":"https://github.com/dotnet/corefx/pull/14778#discussion_r94269175","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/14778","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/94269175"},"html":{"href":"https://github.com/dotnet/corefx/pull/14778#discussion_r94269175"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/14778"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/14778","id":99783891,"html_url":"https://github.com/dotnet/corefx/pull/14778","diff_url":"https://github.com/dotnet/corefx/pull/14778.diff","patch_url":"https://github.com/dotnet/corefx/pull/14778.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/14778","number":14778,"state":"open","locked":false,"title":"Update LocalAppContext DisableCaching and XmlSchemaSet Tests to fix failure","user":{"login":"safern","id":22899328,"avatar_url":"https://avatars.githubusercontent.com/u/22899328?v=3","gravatar_id":"","url":"https://api.github.com/users/safern","html_url":"https://github.com/safern","followers_url":"https://api.github.com/users/safern/followers","following_url":"https://api.github.com/users/safern/following{/other_user}","gists_url":"https://api.github.com/users/safern/gists{/gist_id}","starred_url":"https://api.github.com/users/safern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/safern/subscriptions","organizations_url":"https://api.github.com/users/safern/orgs","repos_url":"https://api.github.com/users/safern/repos","events_url":"https://api.github.com/users/safern/events{/privacy}","received_events_url":"https://api.github.com/users/safern/received_events","type":"User","site_admin":false},"body":"Fixes #14064\r\n\r\nI updated `LocalAppContext` to get `DisableCaching` switch's value on the first call to `GetCachedSwitchValue` instead of doing it on an static constructor. \r\n\r\nThe tests were failing because the `LocalAppContext` was trying to get `DisableCaching` switch value before it was set to true because other tests that didn't needed `DisableCaching` set to true where calling `LocalAppContext.GetCachedSwitchValue` first and when the tests that needed no caching were trying to get switches values they would get the previously cached value so that would cause the failure.\r\n\r\nIn order to fix this I added an static constructor to `Xml.Tests.TestData` and in that constructor I set the `DisableCaching` switch value to true before `LocalAppContext` tries to get it. The static constructor is the first thing that will be called because `TestData` is referenced from all the tests so when a test is executed the constructor is being called.\r\n\r\n/cc @AlexGhiondea @sepidehMS ","created_at":"2016-12-30T21:17:17Z","updated_at":"2016-12-31T05:07:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"06cb94fa0b404d289ef2b2b17c75088248b69d44","assignee":{"login":"safern","id":22899328,"avatar_url":"https://avatars.githubusercontent.com/u/22899328?v=3","gravatar_id":"","url":"https://api.github.com/users/safern","html_url":"https://github.com/safern","followers_url":"https://api.github.com/users/safern/followers","following_url":"https://api.github.com/users/safern/following{/other_user}","gists_url":"https://api.github.com/users/safern/gists{/gist_id}","starred_url":"https://api.github.com/users/safern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/safern/subscriptions","organizations_url":"https://api.github.com/users/safern/orgs","repos_url":"https://api.github.com/users/safern/repos","events_url":"https://api.github.com/users/safern/events{/privacy}","received_events_url":"https://api.github.com/users/safern/received_events","type":"User","site_admin":false},"assignees":[{"login":"safern","id":22899328,"avatar_url":"https://avatars.githubusercontent.com/u/22899328?v=3","gravatar_id":"","url":"https://api.github.com/users/safern","html_url":"https://github.com/safern","followers_url":"https://api.github.com/users/safern/followers","following_url":"https://api.github.com/users/safern/following{/other_user}","gists_url":"https://api.github.com/users/safern/gists{/gist_id}","starred_url":"https://api.github.com/users/safern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/safern/subscriptions","organizations_url":"https://api.github.com/users/safern/orgs","repos_url":"https://api.github.com/users/safern/repos","events_url":"https://api.github.com/users/safern/events{/privacy}","received_events_url":"https://api.github.com/users/safern/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/4","html_url":"https://github.com/dotnet/corefx/milestone/4","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/4/labels","id":1248719,"number":4,"title":"2.0.0","description":".NET Core 2.0 Placeholder (next major release)\r\nhttps://github.com/dotnet/core/blob/master/roadmap.md\r\n\r\nNote: Previously known as 1.2.","creator":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars.githubusercontent.com/u/1302850?v=3","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":323,"closed_issues":3501,"state":"open","created_at":"2015-08-10T18:04:00Z","updated_at":"2016-12-30T22:51:01Z","due_on":"2017-04-30T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/14778/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/14778/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/14778/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/0e20e48ea063eba8b306bbf65313a72d161b56d2","head":{"label":"safern:XmlTests","ref":"XmlTests","sha":"0e20e48ea063eba8b306bbf65313a72d161b56d2","user":{"login":"safern","id":22899328,"avatar_url":"https://avatars.githubusercontent.com/u/22899328?v=3","gravatar_id":"","url":"https://api.github.com/users/safern","html_url":"https://github.com/safern","followers_url":"https://api.github.com/users/safern/followers","following_url":"https://api.github.com/users/safern/following{/other_user}","gists_url":"https://api.github.com/users/safern/gists{/gist_id}","starred_url":"https://api.github.com/users/safern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/safern/subscriptions","organizations_url":"https://api.github.com/users/safern/orgs","repos_url":"https://api.github.com/users/safern/repos","events_url":"https://api.github.com/users/safern/events{/privacy}","received_events_url":"https://api.github.com/users/safern/received_events","type":"User","site_admin":false},"repo":{"id":71193251,"name":"corefx","full_name":"safern/corefx","owner":{"login":"safern","id":22899328,"avatar_url":"https://avatars.githubusercontent.com/u/22899328?v=3","gravatar_id":"","url":"https://api.github.com/users/safern","html_url":"https://github.com/safern","followers_url":"https://api.github.com/users/safern/followers","following_url":"https://api.github.com/users/safern/following{/other_user}","gists_url":"https://api.github.com/users/safern/gists{/gist_id}","starred_url":"https://api.github.com/users/safern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/safern/subscriptions","organizations_url":"https://api.github.com/users/safern/orgs","repos_url":"https://api.github.com/users/safern/repos","events_url":"https://api.github.com/users/safern/events{/privacy}","received_events_url":"https://api.github.com/users/safern/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/safern/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.","fork":true,"url":"https://api.github.com/repos/safern/corefx","forks_url":"https://api.github.com/repos/safern/corefx/forks","keys_url":"https://api.github.com/repos/safern/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/safern/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/safern/corefx/teams","hooks_url":"https://api.github.com/repos/safern/corefx/hooks","issue_events_url":"https://api.github.com/repos/safern/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/safern/corefx/events","assignees_url":"https://api.github.com/repos/safern/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/safern/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/safern/corefx/tags","blobs_url":"https://api.github.com/repos/safern/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/safern/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/safern/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/safern/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/safern/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/safern/corefx/languages","stargazers_url":"https://api.github.com/repos/safern/corefx/stargazers","contributors_url":"https://api.github.com/repos/safern/corefx/contributors","subscribers_url":"https://api.github.com/repos/safern/corefx/subscribers","subscription_url":"https://api.github.com/repos/safern/corefx/subscription","commits_url":"https://api.github.com/repos/safern/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/safern/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/safern/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/safern/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/safern/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/safern/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/safern/corefx/merges","archive_url":"https://api.github.com/repos/safern/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/safern/corefx/downloads","issues_url":"https://api.github.com/repos/safern/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/safern/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/safern/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/safern/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/safern/corefx/labels{/name}","releases_url":"https://api.github.com/repos/safern/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/safern/corefx/deployments","created_at":"2016-10-18T00:37:15Z","updated_at":"2016-10-18T00:37:45Z","pushed_at":"2016-12-31T00:50:07Z","git_url":"git://github.com/safern/corefx.git","ssh_url":"git@github.com:safern/corefx.git","clone_url":"https://github.com/safern/corefx.git","svn_url":"https://github.com/safern/corefx","homepage":"https://docs.microsoft.com/dotnet/","size":125324,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"3860fe87088c38e0093952ecfcc01f9cc01c628e","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":26295345,"name":"corefx","full_name":"dotnet/corefx","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.","fork":false,"url":"https://api.github.com/repos/dotnet/corefx","forks_url":"https://api.github.com/repos/dotnet/corefx/forks","keys_url":"https://api.github.com/repos/dotnet/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefx/teams","hooks_url":"https://api.github.com/repos/dotnet/corefx/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefx/events","assignees_url":"https://api.github.com/repos/dotnet/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefx/tags","blobs_url":"https://api.github.com/repos/dotnet/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefx/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefx/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefx/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefx/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefx/subscription","commits_url":"https://api.github.com/repos/dotnet/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefx/merges","archive_url":"https://api.github.com/repos/dotnet/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefx/downloads","issues_url":"https://api.github.com/repos/dotnet/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefx/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/corefx/deployments","created_at":"2014-11-06T23:42:48Z","updated_at":"2016-12-30T22:03:56Z","pushed_at":"2016-12-31T04:10:11Z","git_url":"git://github.com/dotnet/corefx.git","ssh_url":"git@github.com:dotnet/corefx.git","clone_url":"https://github.com/dotnet/corefx.git","svn_url":"https://github.com/dotnet/corefx","homepage":"https://docs.microsoft.com/dotnet/","size":126864,"stargazers_count":11027,"watchers_count":11027,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2833,"mirror_url":null,"open_issues_count":1322,"forks":2833,"open_issues":1322,"watchers":11027,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/14778"},"html":{"href":"https://github.com/dotnet/corefx/pull/14778"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/14778"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/14778/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/14778/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/14778/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/0e20e48ea063eba8b306bbf65313a72d161b56d2"}}}}
{"actor":{"display_login":"AlexGhiondea"}}