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

DivideByZeroException when there are no tests discovered #2615

Closed
marek-safar opened this issue Nov 3, 2020 · 0 comments · Fixed by #2723
Closed

DivideByZeroException when there are no tests discovered #2615

marek-safar opened this issue Nov 3, 2020 · 0 comments · Fixed by #2723
Assignees

Comments

@marek-safar
Copy link
Member

marek-safar commented Nov 3, 2020

The verbose log contains following exception when there are no tests discovered (probably accidentally)

TpTrace Error: 0 : 70249, 5, 2020/11/03, 14:16:15.282, 1591260085400598, vstest.console.dll, InternalTestLoggerEvents.SendTestRunComplete: Exception occurred while calling handler of type Microsoft.VisualStudio.TestPlatform.Extensions.HtmlLogger.HtmlLogger for TestRunCompleteEventArgs: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.DivideByZeroException: Attempted to divide by zero.
   at Microsoft.VisualStudio.TestPlatform.Extensions.HtmlLogger.HtmlLogger.TestRunCompleteHandler(Object sender, TestRunCompleteEventArgs e)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Delegate.DynamicInvoke(Object[] args)
   at Microsoft.VisualStudio.TestPlatform.Utilities.MulticastDelegateUtilities.SafeInvoke(Delegate delegates, Object sender, EventArgs args, String traceDisplayName)

this points to this line

PassPercentage = (PassedTests * 100) / TotalTests,

AB#1272732

@nohwnd nohwnd self-assigned this Nov 4, 2020
@nohwnd nohwnd added the sprint label Feb 1, 2021
@ghost ghost closed this as completed in #2723 Feb 1, 2021
@pavelhorak pavelhorak removed the sprint label Mar 22, 2021
This issue was closed.
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

Successfully merging a pull request may close this issue.

3 participants