{"action":"created","issue":{"url":"https://api.github.com/repos/mmanela/chutzpah/issues/460","labels_url":"https://api.github.com/repos/mmanela/chutzpah/issues/460/labels{/name}","comments_url":"https://api.github.com/repos/mmanela/chutzpah/issues/460/comments","events_url":"https://api.github.com/repos/mmanela/chutzpah/issues/460/events","html_url":"https://github.com/mmanela/chutzpah/issues/460","id":128413845,"number":460,"title":"Test Adapter for Test Explorer throws System.AggregateException","user":{"login":"SeanSobey","id":9336299,"avatar_url":"https://avatars.githubusercontent.com/u/9336299?v=3","gravatar_id":"","url":"https://api.github.com/users/SeanSobey","html_url":"https://github.com/SeanSobey","followers_url":"https://api.github.com/users/SeanSobey/followers","following_url":"https://api.github.com/users/SeanSobey/following{/other_user}","gists_url":"https://api.github.com/users/SeanSobey/gists{/gist_id}","starred_url":"https://api.github.com/users/SeanSobey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SeanSobey/subscriptions","organizations_url":"https://api.github.com/users/SeanSobey/orgs","repos_url":"https://api.github.com/users/SeanSobey/repos","events_url":"https://api.github.com/users/SeanSobey/events{/privacy}","received_events_url":"https://api.github.com/users/SeanSobey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-24T17:58:06Z","updated_at":"2016-01-24T18:27:25Z","closed_at":null,"body":"Hi\r\n\r\nSince VS 2015 tests that ran fine in the VS 2013 adapter are now throwing errors. They work fine on our build machine through TFS running Chutzpah so I assume it is just the adapter that has issues.\r\n\r\nSome investigation indicates that a few scenarios cause the errors but they all give an Interop COM message:\r\n<code>Error: System.AggregateException: One or more errors occurred. ---> System.Runtime.InteropServices.COMException: The specified test case was not found in the current result context (mapping test id to test node).</code>\r\n\r\nThis is the full output from the Tests window:\r\n```\r\n------ Run test started ------\r\nError: System.AggregateException: One or more errors occurred. ---> System.Runtime.InteropServices.COMException: The specified test case was not found in the current result context (mapping test id to test node).\r\n   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)\r\n   at WEX.TestExecution.FrameworkHandle.RecordStart(TestCase testCase)\r\n   at Chutzpah.VS2012.TestAdapter.ExecutionCallback.TestStarted(TestCase test)\r\n   at Chutzpah.Callbacks.ParallelRunnerCallbackAdapter.TestStarted(TestCase testCase)\r\n   at Chutzpah.TestCaseStreamReader.ReadFromStream(StreamReader stream, TestContext testContext, TestOptions testOptions, IList`1 streamingTestFileContexts, IList`1 deferredEvents, ITestMethodRunnerCallback callback, Boolean debugEnabled)\r\n   at Chutzpah.TestCaseStreamReader.<>c__DisplayClass8.<Read>b__2()\r\n   at System.Threading.Tasks.Task`1.InnerInvoke()\r\n   at System.Threading.Tasks.Task.Execute()\r\n   --- End of inner exception stack trace ---\r\n   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)\r\n   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)\r\n   at System.Threading.Tasks.Task`1.get_Result()\r\n   at Chutzpah.TestCaseStreamReader.Read(ProcessStream processStream, TestOptions testOptions, TestContext testContext, ITestMethodRunnerCallback callback, Boolean debugEnabled)\r\n   at Chutzpah.TestRunner.<>c__DisplayClass1d.<InvokeTestRunner>b__1a(ProcessStream processStream)\r\n   at Chutzpah.ProcessHelper.RunExecutableAndProcessOutput[T](String exePath, String arguments, Func`2 streamProcessor)\r\n   at Chutzpah.TestRunner.InvokeTestRunner(String headlessBrowserPath, TestOptions options, TestContext testContext, TestExecutionMode testExecutionMode, ITestMethodRunnerCallback callback)\r\n   at Chutzpah.TestRunner.<>c__DisplayClassc.<ExecuteTestContexts>b__b(TestContext testContext)\r\n---> (Inner Exception #0) System.Runtime.InteropServices.COMException (0x80070490): The specified test case was not found in the current result context (mapping test id to test node).\r\n   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)\r\n   at WEX.TestExecution.FrameworkHandle.RecordStart(TestCase testCase)\r\n   at Chutzpah.VS2012.TestAdapter.ExecutionCallback.TestStarted(TestCase test)\r\n   at Chutzpah.Callbacks.ParallelRunnerCallbackAdapter.TestStarted(TestCase testCase)\r\n   at Chutzpah.TestCaseStreamReader.ReadFromStream(StreamReader stream, TestContext testContext, TestOptions testOptions, IList`1 streamingTestFileContexts, IList`1 deferredEvents, ITestMethodRunnerCallback callback, Boolean debugEnabled)\r\n   at Chutzpah.TestCaseStreamReader.<>c__DisplayClass8.<Read>b__2()\r\n   at System.Threading.Tasks.Task`1.InnerInvoke()\r\n   at System.Threading.Tasks.Task.Execute()<---\r\n\r\nWhile Running:c:\\tfs\\sirc\\core\\sage.intelligence.officeaddin.tests\\src\\test.tests.js\r\n\r\n========== Run test finished: 0 run (0:00:03.8244173) ==========\r\n```\r\n\r\nThis can be caused by running the tests from the Test Explorer.\r\n\r\nInterestingly it appears a single test runs ok. This can be replicated in a new project with a simple test file (example.tests.js):\r\n\r\n```\r\n(function () {\r\n\t\"use strict\";\r\n\t\r\n\tdescribe(\"Tests\", function () {\r\n\r\n\t\tit(\"tests A\", function () {\r\n\r\n\t\t\texpect(false).toEqual(true);\r\n\t\t});\r\n\t\tit(\"tests B\", function () {\r\n\r\n\t\t\texpect(false).toEqual(true);\r\n\t\t});\r\n\t});\r\n})();\r\n```\r\n\r\nI have a chutzpah.json as well if its relevant:\r\n\r\n```\r\n{\r\n\t\"RootReferencePathMode\": \"SettingsFileDirectory\",\r\n\t\"Tests\": [\r\n\t\t{\r\n\t\t\t\"Path\": \"src\",\r\n\t\t\t\"Includes\": [ \"*.tests.js\" ],\r\n\t\t\t\"ExpandReferenceComments\": true\r\n\t\t}\r\n\t]\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/mmanela/chutzpah/issues/comments/174327765","html_url":"https://github.com/mmanela/chutzpah/issues/460#issuecomment-174327765","issue_url":"https://api.github.com/repos/mmanela/chutzpah/issues/460","id":174327765,"user":{"login":"mmanela","id":304410,"avatar_url":"https://avatars.githubusercontent.com/u/304410?v=3","gravatar_id":"","url":"https://api.github.com/users/mmanela","html_url":"https://github.com/mmanela","followers_url":"https://api.github.com/users/mmanela/followers","following_url":"https://api.github.com/users/mmanela/following{/other_user}","gists_url":"https://api.github.com/users/mmanela/gists{/gist_id}","starred_url":"https://api.github.com/users/mmanela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmanela/subscriptions","organizations_url":"https://api.github.com/users/mmanela/orgs","repos_url":"https://api.github.com/users/mmanela/repos","events_url":"https://api.github.com/users/mmanela/events{/privacy}","received_events_url":"https://api.github.com/users/mmanela/received_events","type":"User","site_admin":false},"created_at":"2016-01-24T18:27:25Z","updated_at":"2016-01-24T18:27:25Z","body":"Thanks for reporting the issue. I tried to follow your steps and repro but I could not. I was able to run the tests you posted and get the two failures fine. Here is the code I used:\r\n\r\nhttps://github.com/mmanela/Issue-Chutzpah-460\r\n\r\nLet me know if I am missing something. "}}