diff --git a/tests/pytest/crash_gen/crash_gen.py b/tests/pytest/crash_gen/crash_gen.py index 3759f2b00fb936b3957a64d6d1ad9bf889d01e3c..8d2b0080bc69f5ca84852448dc5ccb197044b319 100755 --- a/tests/pytest/crash_gen/crash_gen.py +++ b/tests/pytest/crash_gen/crash_gen.py @@ -1656,7 +1656,8 @@ class TaskReadData(StateTransitionTask): # 1 in 5 chance, simulate a broken connection, only if service stable (not restarting) if random.randrange(20)==0: # and self._canRestartService(): # TODO: break connection in all situations - Logging.info("Attempting to reconnect to server") # TODO: change to DEBUG + # Logging.info("Attempting to reconnect to server") # TODO: change to DEBUG + Progress.emit(Progress.SERVICE_RECONNECT_START) try: wt.getDbConn().close() wt.getDbConn().open() @@ -1667,9 +1668,12 @@ class TaskReadData(StateTransitionTask): if gSvcMgr.isRunning(): # may have race conditon, but low prob, due to Logging.error("Failed to reconnect when managed server is running") raise # Not OK if we are running normally - Logging.info("Ignoring DB reconnect error") - print("_r", end="", flush=True) + Progress.emit(Progress.SERVICE_RECONNECT_FAILURE) + # Logging.info("Ignoring DB reconnect error") + + # print("_r", end="", flush=True) + Progress.emit(Progress.SERVICE_RECONNECT_SUCCESS) # The above might have taken a lot of time, service might be running # by now, causing error below to be incorrectly handled due to timing issue return # TODO: fix server restart status race condtion diff --git a/tests/pytest/crash_gen/misc.py b/tests/pytest/crash_gen/misc.py index 8a2817b3898ac5ca0f5518b95274c0826e1c42b4..34a33c6af60d6fe419ba9b565265e6769a78ce14 100644 --- a/tests/pytest/crash_gen/misc.py +++ b/tests/pytest/crash_gen/misc.py @@ -163,11 +163,17 @@ class Progress: BEGIN_THREAD_STEP = 1 END_THREAD_STEP = 2 SERVICE_HEART_BEAT= 3 + SERVICE_RECONNECT_START = 4 + SERVICE_RECONNECT_SUCCESS = 5 + SERVICE_RECONNECT_FAILURE = 6 tokens = { STEP_BOUNDARY: '.', BEGIN_THREAD_STEP: '[', END_THREAD_STEP: '] ', - SERVICE_HEART_BEAT: '.Y.' + SERVICE_HEART_BEAT: '.Y.', + SERVICE_RECONNECT_START: '', + SERVICE_RECONNECT_FAILURE: '.xr>', } @classmethod