Fix serialization tests & don't block thread (#846)

* Fix serialization tests & don't block thread
- Fixed potential null ref when closing streams
- Always clean up serialization queue if an error occurs
- Stop blocking dispatcher thread by not awaiting task that processes the message
- Improved error logging in EventFlowValidator to help debug issues
- Close stream on exception
This commit is contained in:
Kevin Cunnane
2019-08-09 09:48:57 -07:00
committed by GitHub
parent 4fe02a6885
commit d42e3626cb
4 changed files with 84 additions and 55 deletions

View File

@@ -153,7 +153,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Common.RequestContextMocking
ReceivedEvent received = ReceivedEvents[i];
// Step 1) Make sure the event type matches
Assert.Equal(expected.EventType, received.EventType);
Assert.True(expected.EventType.Equals(received.EventType),
string.Format("Expected EventType {0} but got {1}. Received object is {2}", expected.EventType, received.EventType, received.EventObject.ToString()));
// Step 2) Make sure the param type matches
Assert.True( expected.ParamType == received.EventObject.GetType()