{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vstest/issues/893","repository_url":"https://api.github.com/repos/Microsoft/vstest","labels_url":"https://api.github.com/repos/Microsoft/vstest/issues/893/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vstest/issues/893/comments","events_url":"https://api.github.com/repos/Microsoft/vstest/issues/893/events","html_url":"https://github.com/Microsoft/vstest/issues/893","id":238488017,"number":893,"title":"NUnit 3 test adapter (.NET Framework) reports tests twice","user":{"login":"yaakov-h","id":426009,"avatar_url":"https://avatars2.githubusercontent.com/u/426009?v=3","gravatar_id":"","url":"https://api.github.com/users/yaakov-h","html_url":"https://github.com/yaakov-h","followers_url":"https://api.github.com/users/yaakov-h/followers","following_url":"https://api.github.com/users/yaakov-h/following{/other_user}","gists_url":"https://api.github.com/users/yaakov-h/gists{/gist_id}","starred_url":"https://api.github.com/users/yaakov-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaakov-h/subscriptions","organizations_url":"https://api.github.com/users/yaakov-h/orgs","repos_url":"https://api.github.com/users/yaakov-h/repos","events_url":"https://api.github.com/users/yaakov-h/events{/privacy}","received_events_url":"https://api.github.com/users/yaakov-h/received_events","type":"User","site_admin":false},"labels":[{"id":404205520,"url":"https://api.github.com/repos/Microsoft/vstest/labels/bug","name":"bug","color":"ee0701","default":true},{"id":450349970,"url":"https://api.github.com/repos/Microsoft/vstest/labels/exp:%20cli","name":"exp: cli","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":{"login":"Faizan2304","id":19184362,"avatar_url":"https://avatars1.githubusercontent.com/u/19184362?v=3","gravatar_id":"","url":"https://api.github.com/users/Faizan2304","html_url":"https://github.com/Faizan2304","followers_url":"https://api.github.com/users/Faizan2304/followers","following_url":"https://api.github.com/users/Faizan2304/following{/other_user}","gists_url":"https://api.github.com/users/Faizan2304/gists{/gist_id}","starred_url":"https://api.github.com/users/Faizan2304/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Faizan2304/subscriptions","organizations_url":"https://api.github.com/users/Faizan2304/orgs","repos_url":"https://api.github.com/users/Faizan2304/repos","events_url":"https://api.github.com/users/Faizan2304/events{/privacy}","received_events_url":"https://api.github.com/users/Faizan2304/received_events","type":"User","site_admin":false},"assignees":[{"login":"Faizan2304","id":19184362,"avatar_url":"https://avatars1.githubusercontent.com/u/19184362?v=3","gravatar_id":"","url":"https://api.github.com/users/Faizan2304","html_url":"https://github.com/Faizan2304","followers_url":"https://api.github.com/users/Faizan2304/followers","following_url":"https://api.github.com/users/Faizan2304/following{/other_user}","gists_url":"https://api.github.com/users/Faizan2304/gists{/gist_id}","starred_url":"https://api.github.com/users/Faizan2304/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Faizan2304/subscriptions","organizations_url":"https://api.github.com/users/Faizan2304/orgs","repos_url":"https://api.github.com/users/Faizan2304/repos","events_url":"https://api.github.com/users/Faizan2304/events{/privacy}","received_events_url":"https://api.github.com/users/Faizan2304/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Microsoft/vstest/milestones/25","html_url":"https://github.com/Microsoft/vstest/milestone/25","labels_url":"https://api.github.com/repos/Microsoft/vstest/milestones/25/labels","id":2627473,"number":25,"title":"15.5 (Sprint 121)","description":"","creator":{"login":"codito","id":28766,"avatar_url":"https://avatars1.githubusercontent.com/u/28766?v=3","gravatar_id":"","url":"https://api.github.com/users/codito","html_url":"https://github.com/codito","followers_url":"https://api.github.com/users/codito/followers","following_url":"https://api.github.com/users/codito/following{/other_user}","gists_url":"https://api.github.com/users/codito/gists{/gist_id}","starred_url":"https://api.github.com/users/codito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codito/subscriptions","organizations_url":"https://api.github.com/users/codito/orgs","repos_url":"https://api.github.com/users/codito/repos","events_url":"https://api.github.com/users/codito/events{/privacy}","received_events_url":"https://api.github.com/users/codito/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":2,"state":"open","created_at":"2017-07-07T12:24:17Z","updated_at":"2017-07-13T06:53:25Z","due_on":"2017-07-28T07:00:00Z","closed_at":null},"comments":2,"created_at":"2017-06-26T09:30:47Z","updated_at":"2017-07-13T14:54:36Z","closed_at":null,"body":"## Description\r\nWhen running tests via `VsTestConsoleWrapper`, the following callbacks are called:\r\n\r\n1. `HandleDiscoveredTests(a bunch of tests)`\r\n2. `HandleDiscoveryComplete(N, lastChunk: the same bunch of tests, isAborted: false)`\r\n\r\n## Steps to reproduce\r\nSee #881 for repro cases and sample code. Based on the log files, this appears to be a bug in VSTest, not the adapter.\r\n\r\n## Expected behavior\r\n`HandleDiscoveredTests` is called with a bunch of tests\r\n`HandleDiscoveryComplete` is called with a `lastChunk` of null.\r\n\r\n## Actual behavior\r\n`HandleDiscoveryComplete` is called with a `lastChunk` of previously-discovered tests.\r\n\r\n## Environment\r\nUsing `Microsoft.TestPlatform` 15.0.0.0 from the MyGet feed.\r\nUsing NUnit3 test adapter 3.8.0-alpha1 from NuGet.\r\nWindows 10 v1703\r\n\r\nThis behaviour does not occur with the same adapter for .NET Core.\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/vstest/issues/comments/315102579","html_url":"https://github.com/Microsoft/vstest/issues/893#issuecomment-315102579","issue_url":"https://api.github.com/repos/Microsoft/vstest/issues/893","id":315102579,"user":{"login":"Faizan2304","id":19184362,"avatar_url":"https://avatars1.githubusercontent.com/u/19184362?v=3","gravatar_id":"","url":"https://api.github.com/users/Faizan2304","html_url":"https://github.com/Faizan2304","followers_url":"https://api.github.com/users/Faizan2304/followers","following_url":"https://api.github.com/users/Faizan2304/following{/other_user}","gists_url":"https://api.github.com/users/Faizan2304/gists{/gist_id}","starred_url":"https://api.github.com/users/Faizan2304/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Faizan2304/subscriptions","organizations_url":"https://api.github.com/users/Faizan2304/orgs","repos_url":"https://api.github.com/users/Faizan2304/repos","events_url":"https://api.github.com/users/Faizan2304/events{/privacy}","received_events_url":"https://api.github.com/users/Faizan2304/received_events","type":"User","site_admin":false},"created_at":"2017-07-13T14:54:36Z","updated_at":"2017-07-13T14:54:36Z","body":"@yaakov-h : This behavior is not a bug but by design. The TestPlatform doesn't say that last chunk will be null. [See Sample Code](https://github.com/Microsoft/vstest/blob/master/samples/Microsoft.TestPlatform.TranslationLayer.E2ETest/Program.cs#L206)\r\n\r\n### Benefit of having last chunk in HandleDiscoveryCompleted\r\nTestPlatform send HandleDiscoveredTests if number of discovered test is more than a particular size(default is 10 (and this is customizable through run setting)) or time elapsed from last call of HandleDiscoveryCompleted is more than 1.5 second [Code here](https://github.com/Microsoft/vstest/blob/master/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryResultCache.cs#L128)\r\n\r\nIf any test left after above check we send it in last chunk of HandleDiscoveryCompleted [Code here](https://github.com/Microsoft/vstest/blob/master/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryManager.cs#L124)\r\n\r\nNow consider a scenario where there is only one tests in test project:\r\nWe need to call only one event of HandleDiscoveryCompleted with last chunk which will have one test. Now if we don't want to send test in last chunk then we have to make two call \r\na) HandleDiscoveredTests with one test\r\nb) HandleDiscoveryCompleted with last chunk null. \r\n\r\n### Why the behavior is different in case of netcore and net framework\r\nThis is due to internal implementation of how we run test for netcore test project.  You will see the same behavior if you will run .NET framework test with parallel enabled.\r\n\r\nCan you please let me know what are the issue you are facing due to this behavior"}}
{"actor":{"display_login":"Faizan2304"}}