Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when running/debugging tests #48

Open
ngates87 opened this issue Jan 5, 2016 · 1 comment
Open

Exception when running/debugging tests #48

ngates87 opened this issue Jan 5, 2016 · 1 comment

Comments

@ngates87
Copy link

ngates87 commented Jan 5, 2016

I am actually seeing 2 issues when running test, if I use the test explorer just to run a single test I see this, in the output window

------ Run test started ------ ========== Run test finished: 0 run (0:00:01.019) ==========

And when I try to debug said test, I get the following exception, which my explain the previous problem.

System.AggregateException was unhandled by user code
  HResult=-2146233088
  Message=One or more errors occurred.
  Source=mscorlib
  StackTrace:
       at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
       at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
       at System.Threading.Tasks.Task`1.get_Result()
       at JsTestAdapter.TestAdapter.TestRunner.RunTests(IEnumerable`1 sources, IRunContext runContext, IFrameworkHandle frameworkHandle) in c:\Git\JsTestAdapter\JsTestAdapter\TestAdapter\TestRunner.cs:line 138
       at JsTestAdapter.TestAdapter.TestRunner.RunTests(IEnumerable`1 tests, IRunContext runContext, IFrameworkHandle frameworkHandle) in c:\Git\JsTestAdapter\JsTestAdapter\TestAdapter\TestRunner.cs:line 155
       at WEX.TestExecution.ExecutionPlugin.ExecuteTests(IntPtr context, IDictionary`2 rockSteadySettings)
       at WEX.TestExecution.InteropMethods.ExecuteTests(IntPtr context, String[] rockSteadySettings, Int32 rockSteadySettingsSize)
  InnerException: 
       ErrorCode=-2147023728
       HResult=-2147023728
       Message=The specified test case was not found in the current result context (mapping test id to test node).
       Source=""
       StackTrace:
            at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
            at WEX.TestExecution.FrameworkHandle.RecordStart(TestCase testCase)
            at JsTestAdapter.TestAdapter.TestRunner.RunTest(TestSourceSettings settings, ITestLogger logger, IRunContext runContext, IFrameworkHandle frameworkHandle, Spec spec) in c:\Git\JsTestAdapter\JsTestAdapter\TestAdapter\TestRunner.cs:line 185
            at JsTestAdapter.TestAdapter.TestRunner.<>c__DisplayClassc.<RunTests>b__a(Spec spec) in c:\Git\JsTestAdapter\JsTestAdapter\TestAdapter\TestRunner.cs:line 168
            at JsTestAdapter.TestServerClient.DiscoverCommand.<>c__DisplayClass1.<Run>b__0(JObject message) in c:\Git\JsTestAdapter\JsTestAdapter\TestServerClient\DiscoverCommand.cs:line 21
            at JsTestAdapter.JsonServerClient.JsonServerCommand.<>c__DisplayClassb.<RunInternal>b__4(JObject message) in c:\Git\JsTestAdapter\JsTestAdapter\JsonServerClient\JsonServerCommand.cs:line 81
         --- End of stack trace from previous location where exception was thrown ---
            at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
            at JsTestAdapter.JsonServerClient.JsonServerCommand.<RunInternal>d__d.MoveNext() in c:\Git\JsTestAdapter\JsTestAdapter\JsonServerClient\JsonServerCommand.cs:line 99
         --- End of stack trace from previous location where exception was thrown ---
            at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
            at JsTestAdapter.JsonServerClient.JsonServerCommand.<RunInternal>d__0.MoveNext() in c:\Git\JsTestAdapter\JsTestAdapter\JsonServerClient\JsonServerCommand.cs:line 53
         --- End of stack trace from previous location where exception was thrown ---
            at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
            at JsTestAdapter.TestServerClient.DiscoverCommand.<Run>d__3.MoveNext() in c:\Git\JsTestAdapter\JsTestAdapter\TestServerClient\DiscoverCommand.cs:line 21
         --- End of stack trace from previous location where exception was thrown ---
            at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
            at JsTestAdapter.TestAdapter.TestRunner.<RunTests>d__e.MoveNext() in c:\Git\JsTestAdapter\JsTestAdapter\TestAdapter\TestRunner.cs:line 166
       InnerException: 

seems to throw on this line
frameworkHandle.RecordStart(testCase);

 private void RunTest(TestSourceSettings settings, ITestLogger logger, IRunContext runContext, IFrameworkHandle frameworkHandle, Spec spec)
        {
            var testCase = CreateTestCase(settings, spec);
            var outcome = TestOutcome.None;

         frameworkHandle.RecordStart(testCase);
            foreach (var result in spec.Results)
            {
                if (result.Skipped && outcome != TestOutcome.Failed)
                {
                    outcome = TestOutcome.Skipped;
                }

                if (result.Success && outcome == TestOutcome.None)
                {
                    outcome = TestOutcome.Passed;
                }

                if (!result.Success && !result.Skipped)
                {
                    outcome = TestOutcome.Failed;
                }

                frameworkHandle.RecordResult(GetResult(testCase, result, frameworkHandle));
            }
            frameworkHandle.RecordEnd(testCase, outcome);
        }```


I found a similar reported error here, https://github.com/xunit/xunit/issues/492 looks like it could be a VS update 1 related bug?

Has anyone else seen this? Could I be doing something wrong? Is there some things to double check?
@johnpankowicz
Copy link

I am getting the same exception whenever I attempt to debug any test.
For example if I set a breakpoint on the second instruction here:

it("TEST0", function () {
   expect(true).toBe(true);
});

I get the same exception with this stack trace:

System.AggregateException was unhandled by user code
HResult=-2146233088
Message=One or more errors occurred.
Source=mscorlib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task1.get_Result()
at JsTestAdapter.TestAdapter.TestRunner.RunTests(IEnumerable1 sources, IRunContext runContext, IFrameworkHandle frameworkHandle) in c:\Git\JsTestAdapter\JsTestAdapter\TestAdapter\TestRunner.cs:line 138 at JsTestAdapter.TestAdapter.TestRunner.RunTests(IEnumerable1 tests, IRunContext runContext, IFrameworkHandle frameworkHandle) in c:\Git\JsTestAdapter\JsTestAdapter\TestAdapter\TestRunner.cs:line 155
at WEX.TestExecution.ExecutionPlugin.ExecuteTests(IntPtr context, IDictionary2 rockSteadySettings) at WEX.TestExecution.InteropMethods.ExecuteTests(IntPtr context, String[] rockSteadySettings, Int32 rockSteadySettingsSize) InnerException: ErrorCode=-2147023728 HResult=-2147023728 Message=The specified test case was not found in the current result context (mapping test id to test node). Source="" StackTrace: at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at WEX.TestExecution.FrameworkHandle.RecordStart(TestCase testCase) at JsTestAdapter.TestAdapter.TestRunner.RunTest(TestSourceSettings settings, ITestLogger logger, IRunContext runContext, IFrameworkHandle frameworkHandle, Spec spec) in c:\Git\JsTestAdapter\JsTestAdapter\TestAdapter\TestRunner.cs:line 185 at JsTestAdapter.TestAdapter.TestRunner.<>c__DisplayClassc.<RunTests>b__a(Spec spec) in c:\Git\JsTestAdapter\JsTestAdapter\TestAdapter\TestRunner.cs:line 168 at JsTestAdapter.TestServerClient.DiscoverCommand.<>c__DisplayClass1.<Run>b__0(JObject message) in c:\Git\JsTestAdapter\JsTestAdapter\TestServerClient\DiscoverCommand.cs:line 21 at JsTestAdapter.JsonServerClient.JsonServerCommand.<>c__DisplayClassb.<RunInternal>b__4(JObject message) in c:\Git\JsTestAdapter\JsTestAdapter\JsonServerClient\JsonServerCommand.cs:line 81 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at JsTestAdapter.JsonServerClient.JsonServerCommand.d__d.MoveNext() in c:\Git\JsTestAdapter\JsTestAdapter\JsonServerClient\JsonServerCommand.cs:line 99
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at JsTestAdapter.JsonServerClient.JsonServerCommand.d__0.MoveNext() in c:\Git\JsTestAdapter\JsTestAdapter\JsonServerClient\JsonServerCommand.cs:line 53
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at JsTestAdapter.TestServerClient.DiscoverCommand.d__3.MoveNext() in c:\Git\JsTestAdapter\JsTestAdapter\TestServerClient\DiscoverCommand.cs:line 21
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at JsTestAdapter.TestAdapter.TestRunner.d__e.MoveNext() in c:\Git\JsTestAdapter\JsTestAdapter\TestAdapter\TestRunner.cs:line 166
InnerException:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants