Closing connect server if test error and RUN_MODE