{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/vstest/issues/661","repository_url":"https://api.github.com/repos/Microsoft/vstest","labels_url":"https://api.github.com/repos/Microsoft/vstest/issues/661/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/vstest/issues/661/comments","events_url":"https://api.github.com/repos/Microsoft/vstest/issues/661/events","html_url":"https://github.com/Microsoft/vstest/issues/661","id":217006152,"number":661,"title":"Test discovery leaves too many files locked - causes problems for metaprogramming","user":{"login":"mgravell","id":17328,"avatar_url":"https://avatars3.githubusercontent.com/u/17328?v=4","gravatar_id":"","url":"https://api.github.com/users/mgravell","html_url":"https://github.com/mgravell","followers_url":"https://api.github.com/users/mgravell/followers","following_url":"https://api.github.com/users/mgravell/following{/other_user}","gists_url":"https://api.github.com/users/mgravell/gists{/gist_id}","starred_url":"https://api.github.com/users/mgravell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgravell/subscriptions","organizations_url":"https://api.github.com/users/mgravell/orgs","repos_url":"https://api.github.com/users/mgravell/repos","events_url":"https://api.github.com/users/mgravell/events{/privacy}","received_events_url":"https://api.github.com/users/mgravell/received_events","type":"User","site_admin":false},"labels":[{"id":450349970,"url":"https://api.github.com/repos/Microsoft/vstest/labels/exp:%20cli","name":"exp: cli","color":"5319e7","default":false},{"id":404205525,"url":"https://api.github.com/repos/Microsoft/vstest/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"Faizan2304","id":19184362,"avatar_url":"https://avatars2.githubusercontent.com/u/19184362?v=4","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://avatars2.githubusercontent.com/u/19184362?v=4","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":null,"comments":6,"created_at":"2017-03-25T21:31:18Z","updated_at":"2017-12-04T12:25:46Z","closed_at":null,"author_association":"NONE","body":"## Description\r\n\r\nWhen using `dotnet test` (and presumably other approaches), the discovery phase locks dll files, which are kept  locked for the duration of the execution phase. This means that if any of the files are actually *outputs* (meta-programming artefacts), they will prevent the second (etc) test runs from executing successfully\r\n\r\n## Steps to reproduce\r\n\r\n- write a test that emits a dll (meta-programming, `AssemblyBuilder` etc) to the test folder during execution\r\n- run the test (file is generated)\r\n- run the test again (file cannot be regenerated as it is locked by discovery)\r\n\r\nA more complete set of repro steps (including command-line and git commit) is [in this report](https://github.com/xunit/xunit/issues/1183#issue-217001302) (I initially filed against `xunit`, and was redirected here)\r\n\r\n## Expected behavior\r\n\r\nSubsequent test runs succeed, via one of (I have no strong views on which):\r\n\r\n- not locking files between discovery and execution\r\n- allowing an inclusion/exclusion filter **from `dotnet` CLI** to prevent unwanted locks from happening\r\n- implementing shadow-copy so that it doesn't matter what is locked (in the transient folder)\r\n- having obvious options (presumably in `dotnet` tooling hooks) to allow the test directory to be cleaned between runs\r\n\r\n## Actual behavior\r\n\r\nFile is locked; subsequent test runs fail\r\n\r\n## Environment\r\n\r\nWindows 10  x64, `dotnet` 1.0.0, `vstest.console` 15.0.26228.0\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/vstest/issues/comments/348947896","html_url":"https://github.com/Microsoft/vstest/issues/661#issuecomment-348947896","issue_url":"https://api.github.com/repos/Microsoft/vstest/issues/661","id":348947896,"user":{"login":"mayankbansal018","id":24792973,"avatar_url":"https://avatars1.githubusercontent.com/u/24792973?v=4","gravatar_id":"","url":"https://api.github.com/users/mayankbansal018","html_url":"https://github.com/mayankbansal018","followers_url":"https://api.github.com/users/mayankbansal018/followers","following_url":"https://api.github.com/users/mayankbansal018/following{/other_user}","gists_url":"https://api.github.com/users/mayankbansal018/gists{/gist_id}","starred_url":"https://api.github.com/users/mayankbansal018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mayankbansal018/subscriptions","organizations_url":"https://api.github.com/users/mayankbansal018/orgs","repos_url":"https://api.github.com/users/mayankbansal018/repos","events_url":"https://api.github.com/users/mayankbansal018/events{/privacy}","received_events_url":"https://api.github.com/users/mayankbansal018/received_events","type":"User","site_admin":false},"created_at":"2017-12-04T12:25:46Z","updated_at":"2017-12-04T12:25:46Z","author_association":"CONTRIBUTOR","body":"@mgravell , can you please review my above comment, & confirm if it works for you?"}}
{"actor":{"display_login":"mayankbansal018"}}