Conversation
…nection and LaunchHost
| <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
| </resheader> | ||
| <data name="CancellationRequested" xml:space="preserve"> | ||
| <value>Cancelling the operation as requested.</value> |
There was a problem hiding this comment.
Something like "The operation was cancelled." seems better. We can check the existing IDE cancellation message to get more input.
There was a problem hiding this comment.
Okay. I just took this as reference. https://github.com/Microsoft/vstest/blob/09057425a192fd329c32bbee2fd9bdd401751450/src/Microsoft.TestPlatform.CrossPlatEngine/Resources/Resources.resx#L180
And I guess we should remove this string.
| namespace Microsoft.VisualStudio.TestPlatform.Common.Utilities | ||
| { | ||
| using Microsoft.VisualStudio.TestPlatform.ObjectModel; | ||
| using System.Threading; |
|
|
||
| if (ex is AggregateException && ex.InnerException is TaskCanceledException) | ||
| { | ||
| throw new TestPlatformException(Common.Resources.Resources.CancellationRequested); |
There was a problem hiding this comment.
TaskCanceledException might happen because of something other than cancel also. In that case, we might not want exception to part of TestPlatformException.
Here in case of TaskCancelledException, we can check this.CancellationTokenSource.Token.ThrowTestPlatformExceptionIfCancellationRequested(); which will throw TestPlatformException only in case of cancellation.
There was a problem hiding this comment.
Makes sense. Done
| } | ||
|
|
||
| [TestMethod] | ||
| public void StartTestRunForCancelRequestShouldHandleLogMessageWithProperErrorMessage() |
There was a problem hiding this comment.
we can have a unit test for case when exception is not testplatformexception
Description
Fixing error messaging for the cancel during WaitForRequestHandlerConnection and LaunchHost
Related issue
#1661