{"action":"created","issue":{"url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/issues/177","repository_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter","labels_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/issues/177/labels{/name}","comments_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/issues/177/comments","events_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/issues/177/events","html_url":"https://github.com/nunit/nunit3-vs-adapter/issues/177","id":158143492,"number":177,"title":"TFS Build 2015 (vNext) fails when all test pass but Nunit throws a System.Threading.ThreadAbortException","user":{"login":"edoua","id":16338227,"avatar_url":"https://avatars.githubusercontent.com/u/16338227?v=3","gravatar_id":"","url":"https://api.github.com/users/edoua","html_url":"https://github.com/edoua","followers_url":"https://api.github.com/users/edoua/followers","following_url":"https://api.github.com/users/edoua/following{/other_user}","gists_url":"https://api.github.com/users/edoua/gists{/gist_id}","starred_url":"https://api.github.com/users/edoua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edoua/subscriptions","organizations_url":"https://api.github.com/users/edoua/orgs","repos_url":"https://api.github.com/users/edoua/repos","events_url":"https://api.github.com/users/edoua/events{/privacy}","received_events_url":"https://api.github.com/users/edoua/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/labels/closed:wontfix","name":"closed:wontfix","color":"cccccc"},{"url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/labels/is:bug","name":"is:bug","color":"fc2929"},{"url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/labels/pri:normal","name":"pri:normal","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-06-02T13:41:17Z","updated_at":"2016-10-24T17:48:45Z","closed_at":"2016-06-03T18:16:49Z","body":"Hello,\r\n\r\nThe software I work on is built using TFS Build 2015 (vNext) on premise.\r\nWe use NUnit 3 (Nuget version=3.2.1) and NUnit3TestAdapter (Nuget version=3.0.10).\r\nPart of the build process is to execute unit tests.\r\n\r\nThe problem is that the build fails even if all the unit tests pass.\r\nAn exception is apparently generated by NUnit which fails the VSTest Runner.\r\n\r\nHere the output from TFS Build 2015:\r\n```\r\nInformation: Running all tests in XXX.UnitTests.dll \r\n##[error]Error: System.Threading.ThreadAbortException: Thread was being aborted. \r\n##[error]   at NUnit.Engine.Services.DomainManager.DomainUnloader.UnloadOnThread() \r\n##[error]   at System.Threading.ThreadHelper.ThreadStart_Context(Object state) \r\n##[error]   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) \r\n##[error]   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) \r\n##[error]   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) \r\n##[error]   at System.Threading.ThreadHelper.ThreadStart() \r\n##[error]\r\nInformation: NUnit3TestExecutor converted 9 of 9 NUnit test cases\r\n9 test passing\r\n##[error]Test Run Failed.\r\nTotal tests: 181. Passed: 181. Failed: 0. Skipped: 0.\r\nTest execution time: 2,1249 Minutes\r\n##[error]VSTest Test Run failed with exit code: 1\r\nPublishing Test Results...\r\nTest results remaining: 181\r\n```\r\n\r\nI then checked in Visual Studio, where both the Visual Studio Runner and Resharper Runner report successful test run.\r\n\r\n**But** the \"Test Output\" output from Visual Studio is showing: \r\n\r\n```\r\n------ Discover test started ------\r\nNUnit Adapter 3.0.10.0: Test discovery starting\r\nNUnit Adapter 3.0.10.0: Test discovery complete\r\n========== Discover test finished: 2 found (0:00:01,8681868) ==========\r\n------ Run test started ------\r\nNUnit Adapter 3.0.10.0: Test execution started\r\nRunning selected tests in XXX.UnitTests.dll\r\nNUnit3TestExecutor converted 9 of 9 NUnit test cases\r\nRunning selected tests in XXX.UnitTests.dll\r\nNUnit3TestExecutor converted 172 of 172 NUnit test cases\r\nSystem.Threading.ThreadAbortException: Thread was being aborted.\r\n   at NUnit.Engine.Services.DomainManager.DomainUnloader.UnloadOnThread()\r\n   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n   at System.Threading.ThreadHelper.ThreadStart()\r\nNUnit Adapter 3.0.10.0: Test execution complete\r\n========== Run test finished: 181 run (0:01:00,5270521) ==========\r\n```\r\n\r\nI have used xUnit on other project before with TFS Build 2015, and have seem some exceptions not related to the actual unit test being thrown but it did not fail the build.\r\n\r\nCould that be related to https://github.com/nunit/nunit-vs-adapter/issues/92 and/or https://github.com/nunit/nunit-vs-adapter/issues/97 ?\r\nWhich I have encountered too. (I had to comment those ignored tests for our build to succeed)\r\n\r\nThanks\r\n"},"comment":{"url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/issues/comments/255813700","html_url":"https://github.com/nunit/nunit3-vs-adapter/issues/177#issuecomment-255813700","issue_url":"https://api.github.com/repos/nunit/nunit3-vs-adapter/issues/177","id":255813700,"user":{"login":"KirillSelyukov","id":2649725,"avatar_url":"https://avatars.githubusercontent.com/u/2649725?v=3","gravatar_id":"","url":"https://api.github.com/users/KirillSelyukov","html_url":"https://github.com/KirillSelyukov","followers_url":"https://api.github.com/users/KirillSelyukov/followers","following_url":"https://api.github.com/users/KirillSelyukov/following{/other_user}","gists_url":"https://api.github.com/users/KirillSelyukov/gists{/gist_id}","starred_url":"https://api.github.com/users/KirillSelyukov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KirillSelyukov/subscriptions","organizations_url":"https://api.github.com/users/KirillSelyukov/orgs","repos_url":"https://api.github.com/users/KirillSelyukov/repos","events_url":"https://api.github.com/users/KirillSelyukov/events{/privacy}","received_events_url":"https://api.github.com/users/KirillSelyukov/received_events","type":"User","site_admin":false},"created_at":"2016-10-24T17:48:45Z","updated_at":"2016-10-24T17:48:45Z","body":"@CharliePoole Not sure if I can proceed in this thread or should create a separate. I got similar problem (TFS thinks build has failed) with ThreadAbortException, but with 3rd part library code. The output is:\r\n\r\n> System.Threading.ThreadAbortException: Thread was being aborted.\r\n>    at VoltDB.Data.Client.CallbackExecutor.BackgroundThreadRun() in C:\\WORK\\voltdb-client-csharp-master\\VoltDB.Data.Client\\Connections\\Internal\\CallbackExecutor.cs:line 207\r\n>    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n>    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n>    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n>    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n>    at System.Threading.ThreadHelper.ThreadStart()\r\n>    at VoltDB.Data.Client.CallbackExecutor.BackgroundThreadRun() in C:\\WORK\\voltdb-client-csharp-master\\VoltDB.Data.Client\\Connections\\Internal\\CallbackExecutor.cs:line 207\r\n>    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n>    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n>    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n>    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n>    at System.Threading.ThreadHelper.ThreadStart()\r\n\r\nFrom what I saw the library authors are okay with the workflow of aborting threads. Is there a way to make runner not to tread these as a reason to fail build?"}}
{"actor":{"display_login":"KirillSelyukov"}}