Improve debugging of flaky tests

This commit is contained in:
Ben Jackson 2019-07-24 17:02:44 +01:00
commit 325d39b64d

View file

@ -19,6 +19,7 @@ import json
import os import os
import subprocess import subprocess
import shlex import shlex
import traceback
from vimspector import ( breakpoints, from vimspector import ( breakpoints,
code, code,
@ -63,6 +64,8 @@ class DebugSession( object ):
self._server_capabilities = {} self._server_capabilities = {}
def Start( self, launch_variables = {} ): def Start( self, launch_variables = {} ):
self._logger.info( "User requested start debug session with %s",
launch_variables )
self._configuration = None self._configuration = None
self._adapter = None self._adapter = None
@ -162,13 +165,16 @@ class DebugSession( object ):
def _StartWithConfiguration( self, configuration, adapter ): def _StartWithConfiguration( self, configuration, adapter ):
def start(): def start():
self._logger.debug( "Starting debugger from stack context: %s",
traceback.format_stack() )
self._configuration = configuration self._configuration = configuration
self._adapter = adapter self._adapter = adapter
self._logger.info( 'Configuration: {0}'.format( json.dumps( self._logger.info( 'Configuration: %s',
self._configuration ) ) ) json.dumps( self._configuration ) )
self._logger.info( 'Adapter: {0}'.format( json.dumps( self._logger.info( 'Adapter: %s',
self._adapter ) ) ) json.dumps( self._adapter ) )
if not self._uiTab: if not self._uiTab:
self._SetUpUI() self._SetUpUI()
@ -319,9 +325,9 @@ class DebugSession( object ):
self._variablesView.ShowBalloon( self._stackTraceView.GetCurrentFrame(), self._variablesView.ShowBalloon( self._stackTraceView.GetCurrentFrame(),
expression ) expression )
else: else:
self._logger.debug( 'Winnr {0} is not the code window {1}'.format( self._logger.debug( 'Winnr %s is not the code window %s',
winnr, winnr,
self._codeView._window.number ) ) self._codeView._window.number )
def ExpandFrameOrThread( self ): def ExpandFrameOrThread( self ):
self._stackTraceView.ExpandFrameOrThread() self._stackTraceView.ExpandFrameOrThread()
@ -394,8 +400,8 @@ class DebugSession( object ):
persist = True ) persist = True )
return return
self._logger.info( 'Starting debug adapter with: {0}'.format( json.dumps( self._logger.info( 'Starting debug adapter with: %s',
self._adapter ) ) ) json.dumps( self._adapter ) )
self._init_complete = False self._init_complete = False
self._on_init_complete_handlers = [] self._on_init_complete_handlers = []