{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/37490651","id":37490651,"diff_hunk":"@@ -226,4 +226,84 @@ private class TestObject\n             }\n         }\n     }\n-}\n\\ No newline at end of file\n+\n+    [Fact]\n+    public static void ReRegisterForFinalize()\n+    {\n+        ReRegisterForFinalizeTest.Run();\n+    }\n+\n+    private class ReRegisterForFinalizeTest\n+    {\n+        public static void Run()\n+        {\n+            TestObject.Finalized = false;\n+            CreateObject();\n+\n+            GC.Collect();\n+            GC.WaitForPendingFinalizers();\n+\n+            Assert.True(TestObject.Finalized);\n+        }\n+\n+        private static void CreateObject()\n+        {\n+            using (var obj = new TestObject())\n+            {\n+                GC.SuppressFinalize(obj);\n+            }\n+        }\n+\n+        private class TestObject : IDisposable\n+        {\n+            public static bool Finalized { get; set; }\n+\n+            ~TestObject()\n+            {\n+                Finalized = true;\n+            }\n+\n+            public void Dispose()\n+            {\n+                GC.ReRegisterForFinalize(this);\n+            }\n+        }\n+    }\n+\n+    [Fact]\n+    public static void GetTotalMemoryTest_NoForceCollection()\n+    {\n+        GC.Collect();\n+\n+        byte[] bytes = new byte[50000];\n+        int genBefore = GC.GetGeneration(bytes);\n+\n+        Assert.True(GC.GetTotalMemory(false) >= bytes.Length);\n+        Assert.True(GC.GetGeneration(bytes) == genBefore);","path":"src/System.Runtime/tests/System/GC.cs","position":59,"original_position":59,"commit_id":"392378c3b273816b4fc1ec37f0d7209c28953ee9","original_commit_id":"392378c3b273816b4fc1ec37f0d7209c28953ee9","user":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars.githubusercontent.com/u/2642209?v=3","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"body":"The GetGeneration approach works well for the ForceCollection test.  We do run some risk in this NoForceCollection test: if a GC were to occur between the first and second calls to GetGeneration, the object would be promoted.  But as I don't think it's possible to distinguish between a collection forced by this code and one initiated for some other reason, I'm not sure there's much that can be done about it; I suggest we leave this for now, but be prepared to delete the test if it fails with any frequency.","created_at":"2015-08-20T02:42:54Z","updated_at":"2015-08-20T02:42:54Z","html_url":"https://github.com/dotnet/corefx/pull/2872#discussion_r37490651","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/2872","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/37490651"},"html":{"href":"https://github.com/dotnet/corefx/pull/2872#discussion_r37490651"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/2872"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/2872","id":42729302,"html_url":"https://github.com/dotnet/corefx/pull/2872","diff_url":"https://github.com/dotnet/corefx/pull/2872.diff","patch_url":"https://github.com/dotnet/corefx/pull/2872.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/2872","number":2872,"state":"open","locked":false,"title":"Add tests for System.Runtime based on mscorlib code coverage data","user":{"login":"Sridhar-MS","id":9423246,"avatar_url":"https://avatars.githubusercontent.com/u/9423246?v=3","gravatar_id":"","url":"https://api.github.com/users/Sridhar-MS","html_url":"https://github.com/Sridhar-MS","followers_url":"https://api.github.com/users/Sridhar-MS/followers","following_url":"https://api.github.com/users/Sridhar-MS/following{/other_user}","gists_url":"https://api.github.com/users/Sridhar-MS/gists{/gist_id}","starred_url":"https://api.github.com/users/Sridhar-MS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sridhar-MS/subscriptions","organizations_url":"https://api.github.com/users/Sridhar-MS/orgs","repos_url":"https://api.github.com/users/Sridhar-MS/repos","events_url":"https://api.github.com/users/Sridhar-MS/events{/privacy}","received_events_url":"https://api.github.com/users/Sridhar-MS/received_events","type":"User","site_admin":false},"body":"System.Array - add 'BinarySearch' overload tests\r\nSystem.DateTime - add 'GetDateTimeFormats' tests\r\nSystem.Decimal - add 'GetBits' tests\r\nSystem.GC - add 'ReRegisterForFinalize', 'GetTotalMemory' and 'GetGeneration' tests\r\nSystem.Runtime.CompilerServices.ConditionalWeakTable - add new tests\r\nSystem.TimeSpan - add 'ParseExact' tests\r\nSystem.Type - add 'GetType' by name tests\r\nSystem.Uri - fix the C# project to include Uri tests.","created_at":"2015-08-18T18:04:10Z","updated_at":"2015-08-20T02:42:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6782d8c3fccc697af9af394f6f614dfb44b6e66","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/2872/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/2872/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/2872/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/392378c3b273816b4fc1ec37f0d7209c28953ee9","head":{"label":"Sridhar-MS:system-runtime-tests","ref":"system-runtime-tests","sha":"392378c3b273816b4fc1ec37f0d7209c28953ee9","user":{"login":"Sridhar-MS","id":9423246,"avatar_url":"https://avatars.githubusercontent.com/u/9423246?v=3","gravatar_id":"","url":"https://api.github.com/users/Sridhar-MS","html_url":"https://github.com/Sridhar-MS","followers_url":"https://api.github.com/users/Sridhar-MS/followers","following_url":"https://api.github.com/users/Sridhar-MS/following{/other_user}","gists_url":"https://api.github.com/users/Sridhar-MS/gists{/gist_id}","starred_url":"https://api.github.com/users/Sridhar-MS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sridhar-MS/subscriptions","organizations_url":"https://api.github.com/users/Sridhar-MS/orgs","repos_url":"https://api.github.com/users/Sridhar-MS/repos","events_url":"https://api.github.com/users/Sridhar-MS/events{/privacy}","received_events_url":"https://api.github.com/users/Sridhar-MS/received_events","type":"User","site_admin":false},"repo":{"id":26565980,"name":"corefx","full_name":"Sridhar-MS/corefx","owner":{"login":"Sridhar-MS","id":9423246,"avatar_url":"https://avatars.githubusercontent.com/u/9423246?v=3","gravatar_id":"","url":"https://api.github.com/users/Sridhar-MS","html_url":"https://github.com/Sridhar-MS","followers_url":"https://api.github.com/users/Sridhar-MS/followers","following_url":"https://api.github.com/users/Sridhar-MS/following{/other_user}","gists_url":"https://api.github.com/users/Sridhar-MS/gists{/gist_id}","starred_url":"https://api.github.com/users/Sridhar-MS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sridhar-MS/subscriptions","organizations_url":"https://api.github.com/users/Sridhar-MS/orgs","repos_url":"https://api.github.com/users/Sridhar-MS/repos","events_url":"https://api.github.com/users/Sridhar-MS/events{/privacy}","received_events_url":"https://api.github.com/users/Sridhar-MS/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Sridhar-MS/corefx","description":"This repository contains the foundational libraries that make up the .NET Core development stack.","fork":true,"url":"https://api.github.com/repos/Sridhar-MS/corefx","forks_url":"https://api.github.com/repos/Sridhar-MS/corefx/forks","keys_url":"https://api.github.com/repos/Sridhar-MS/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sridhar-MS/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sridhar-MS/corefx/teams","hooks_url":"https://api.github.com/repos/Sridhar-MS/corefx/hooks","issue_events_url":"https://api.github.com/repos/Sridhar-MS/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/Sridhar-MS/corefx/events","assignees_url":"https://api.github.com/repos/Sridhar-MS/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/Sridhar-MS/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/Sridhar-MS/corefx/tags","blobs_url":"https://api.github.com/repos/Sridhar-MS/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sridhar-MS/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sridhar-MS/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sridhar-MS/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sridhar-MS/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/Sridhar-MS/corefx/languages","stargazers_url":"https://api.github.com/repos/Sridhar-MS/corefx/stargazers","contributors_url":"https://api.github.com/repos/Sridhar-MS/corefx/contributors","subscribers_url":"https://api.github.com/repos/Sridhar-MS/corefx/subscribers","subscription_url":"https://api.github.com/repos/Sridhar-MS/corefx/subscription","commits_url":"https://api.github.com/repos/Sridhar-MS/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sridhar-MS/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sridhar-MS/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sridhar-MS/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sridhar-MS/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/Sridhar-MS/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sridhar-MS/corefx/merges","archive_url":"https://api.github.com/repos/Sridhar-MS/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sridhar-MS/corefx/downloads","issues_url":"https://api.github.com/repos/Sridhar-MS/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/Sridhar-MS/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/Sridhar-MS/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/Sridhar-MS/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sridhar-MS/corefx/labels{/name}","releases_url":"https://api.github.com/repos/Sridhar-MS/corefx/releases{/id}","created_at":"2014-11-13T02:11:46Z","updated_at":"2014-11-18T22:04:08Z","pushed_at":"2015-08-19T22:43:43Z","git_url":"git://github.com/Sridhar-MS/corefx.git","ssh_url":"git@github.com:Sridhar-MS/corefx.git","clone_url":"https://github.com/Sridhar-MS/corefx.git","svn_url":"https://github.com/Sridhar-MS/corefx","homepage":"","size":28562,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"139df716a3be2cc06477a311ed54abac920009cc","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}","created_at":"2014-11-06T23:42:48Z","updated_at":"2015-08-20T02:12:50Z","pushed_at":"2015-08-20T00:08:56Z","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":"http://dotnet.github.io/core/","size":62869,"stargazers_count":8227,"watchers_count":8227,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1737,"mirror_url":null,"open_issues_count":553,"forks":1737,"open_issues":553,"watchers":8227,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/2872"},"html":{"href":"https://github.com/dotnet/corefx/pull/2872"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/2872"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/2872/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/2872/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/2872/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/392378c3b273816b4fc1ec37f0d7209c28953ee9"}}}}