Fix for a Cancellation timing issue #1397
Closed
AbhitejJohn wants to merge 1 commit intomicrosoft:masterfrom
Closed
Fix for a Cancellation timing issue #1397AbhitejJohn wants to merge 1 commit intomicrosoft:masterfrom
AbhitejJohn wants to merge 1 commit intomicrosoft:masterfrom
Conversation
… has been started is being ignored. We have the right plumbing in place but just seem to have missed initializing a var. Put that in place. All interface changes are internal only.
Contributor
Author
|
This might be targeted to the wrong branch. Do let me know which branch I should target to for 15.6. |
singhsarab
reviewed
Jan 31, 2018
| /// <param name="eventHandler"> EventHandler for handling execution events from Engine. </param> | ||
| public virtual void Cancel(ITestRunEventsHandler eventHandler) | ||
| { | ||
| // Cancel fast, try to stop testhost deployment/launch |
Contributor
There was a problem hiding this comment.
Based on our assumption everywhere else, that is Cancel comes before StartTestRun.
If Cancel comes, it will result in a HandleTestRunComplete, where we have a baseTestRunEventsHandler which only gets set if Start was called, else it could also potentially cause null reference.
Contributor
|
@AbhitejJohn Does this have all the changes? Please update and push this one in. |
singhsarab
approved these changes
Feb 6, 2018
Contributor
|
Created another for port #1436 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for a timing issue where a cancel request before test run request has been started is being ignored.
We have the right plumbing in place but just seem to have missed initializing a var. Put that in place.
All interface changes are internal only.
Related issue
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/559064
From testhost diag logs, this is the stack trace:
TpTrace Error: 0 : 17096, 8, 2018/01/30, 15:50:44.560, 1284210642450, testhost.x86.exe, LengthPrefixCommunicationChannel: MessageReceived: Exception occurred while calling handler of type Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TestRequestHandler for MessageReceivedEventArgs: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.ExecutionManager.Cancel()
at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TestRequestHandler.OnMessageReceived(Object sender, MessageReceivedEventArgs messageReceivedArgs)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at Microsoft.VisualStudio.TestPlatform.Utilities.MulticastDelegateUtilities.SafeInvoke(Delegate delegates, Object sender, EventArgs args, String traceDisplayName)