Fix for Crash due to System.AccessViolationException when calling OleDBSearch from multiple threads. (#6052)

* Removing non thread safe member variables, as well as the check to ensure that they have been disposed.

* Removing 'ExecuteQuery_ShouldDisposeAllConnections_AfterFunctionCall'.

This call previously required the use of member variables that were not thread safe.   There is no reason to share this state across threads.  Arguably this test verifies an internal implementation detail and is not suitable for a unit test anyway.
This commit is contained in:
ryanbodrug-microsoft
2020-08-19 17:28:19 -07:00
committed by GitHub
parent 64106cba82
commit 2390368d03
3 changed files with 12 additions and 101 deletions

View File

@@ -164,22 +164,6 @@ namespace Wox.Test.Plugins
Assert.IsTrue(queryHelper.QueryWhereRestrictions.Contains("Contains"));
}
[Test]
[Ignore("This method is throwing the follwoing exception in CI. Ignoring temporarily until I understand why. Can't repro locally. System.Data.OleDb.OleDbException : IErrorInfo.GetDescription failed with E_FAIL(0x80004005).")]
public void ExecuteQuery_ShouldDisposeAllConnections_AfterFunctionCall()
{
// Arrange
OleDBSearch oleDbSearch = new OleDBSearch();
WindowsSearchAPI api = new WindowsSearchAPI(oleDbSearch);
var mockSearchManager = GetMockSearchManager();
// Act
api.Search("FilePath", mockSearchManager);
// Assert
Assert.IsTrue(oleDbSearch.HaveAllDisposableItemsBeenDisposed());
}
[Test]
public void WindowsSearchAPI_ShouldReturnResults_WhenSearchWasExecuted()
{