Skip to content

Commit

Permalink
Merge pull request #33773 from sharwell/allow-exception
Browse files Browse the repository at this point in the history
Allow specific exception without crash in integration tests
  • Loading branch information
sharwell committed Mar 1, 2019
2 parents d22de2b + ab2e8ab commit f3f3e65
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ namespace Microsoft.VisualStudio.IntegrationTest.Setup
public class TestExtensionErrorHandler : IExtensionErrorHandler
{
public void HandleError(object sender, Exception exception)
=> FatalError.Report(exception);
{
if (exception is ArgumentOutOfRangeException argumentOutOfRangeException
&& argumentOutOfRangeException.ParamName == "index"
&& argumentOutOfRangeException.StackTrace.Contains("Microsoft.NodejsTools.Repl.ReplOutputClassifier.GetClassificationSpans"))
{
// Known issue https://github.com/Microsoft/nodejstools/issues/2138
return;
}

FatalError.Report(exception);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ private static Process StartNewVisualStudioProcess(string installationPath, int
// Disable roaming settings to avoid interference from the online user profile
Process.Start(vsRegEditExeFile, $"set \"{installationPath}\" {Settings.Default.VsRootSuffix} HKCU \"ApplicationPrivateSettings\\Microsoft\\VisualStudio\" RoamingEnabled string \"1*System.Boolean*False\"").WaitForExit();

// Disable text editor error reporting because it pops up a dialog. We want to either fail fast in our
// custom handler or fail silently and continue testing.
Process.Start(vsRegEditExeFile, $"set \"{installationPath}\" {Settings.Default.VsRootSuffix} HKCU \"Text Editor\" \"Report Exceptions\" dword 0").WaitForExit();

_firstLaunch = false;
}

Expand Down

0 comments on commit f3f3e65

Please sign in to comment.