Do a better job of tidying up on test failure; note: We can still receive data callbacks after _OnExit, so just ignore that data

This commit is contained in:
Ben Jackson 2020-07-10 22:49:30 +01:00
commit 6cfc313234
3 changed files with 15 additions and 288 deletions

View file

@ -300,6 +300,10 @@ class DebugSession( object ):
return wrapper
def OnChannelData( self, data ):
if self._connection is None:
# Should _not_ happen, but maybe possible due to races or vim bufs?
return
self._connection.OnData( data )
@ -969,7 +973,9 @@ class DebugSession( object ):
if self._run_on_server_exit:
self._logger.debug( "Running server exit handler" )
self._run_on_server_exit()
callback = self._run_on_server_exit
self._run_on_server_exit = None
callback()
else:
self._logger.debug( "No server exit handler" )