Skip to content

Commit

Permalink
Issue connamara#363: UT update to try to prevent dynamic session test…
Browse files Browse the repository at this point in the history
… teardown code exception
  • Loading branch information
martinadams committed Feb 3, 2016
1 parent c3b9f3c commit 3b1ce07
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions UnitTests/SessionDynamicTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,20 @@ public void TearDown()
{
if (_listenSocket != null)
_listenSocket.Close();

if (_initiator != null)
{
// Give any lingering engine initiator connect attempts time to fail, to avoid any race
// conditions that might arise with the clean up activity that follows
Thread.Sleep(1000);
_initiator.Stop(true);
}
if (_acceptor != null)
_acceptor.Stop(true);

_initiator = null;
_acceptor = null;
_listenSocket = null;

if (System.IO.Directory.Exists(LogPath))
System.IO.Directory.Delete(LogPath, true);
Expand Down

0 comments on commit 3b1ce07

Please sign in to comment.