From c56438d9585710e019dffbaa09cbed5b8591f185 Mon Sep 17 00:00:00 2001 From: Taka Date: Wed, 5 May 2021 07:07:42 +1000 Subject: [PATCH] Fixed a possible timing error in the tests. --- vasl_templates/webapp/config/site.cfg.example | 6 +++--- vasl_templates/webapp/tests/test_vassal.py | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/vasl_templates/webapp/config/site.cfg.example b/vasl_templates/webapp/config/site.cfg.example index b5f638b..b00c84e 100644 --- a/vasl_templates/webapp/config/site.cfg.example +++ b/vasl_templates/webapp/config/site.cfg.example @@ -2,11 +2,11 @@ ; configure VASSAL and VASL VASSAL_DIR = ...configure the VASSAL installation directory... -VASL_MOD = ...configure the VASL module (e.g. vasl-6.5.0.vmod)... -VASL_EXTNS_DIR = ...configured the VASL extensions directory... +VASL_MOD = ...configure the VASL module (e.g. vasl-6.6.2.vmod)... +VASL_EXTNS_DIR = ...configure the VASL extensions directory... BOARDS_DIR = ...configure the VASL boards directory... -; configure support params +; configure support programs ; JAVA_PATH = ...configure the Java executable here (optional, must be in the PATH otherwise)... WEBDRIVER_PATH = ...configure either geckodriver or chromedriver here... diff --git a/vasl_templates/webapp/tests/test_vassal.py b/vasl_templates/webapp/tests/test_vassal.py index 49ad0c7..b12b198 100644 --- a/vasl_templates/webapp/tests/test_vassal.py +++ b/vasl_templates/webapp/tests/test_vassal.py @@ -793,7 +793,12 @@ def _update_vsav( fname, expected ): select_menu_option( "update_vsav" ) # wait for the front-end to receive the data - wait_for( 2, lambda: get_stored_msg( "_vsav-persistence_" ) == "" ) + def check_response(): + # NOTE: If something is misconfigured, the error response can get stored in the persistence buffer + # really quickly i.e. before we get a chance to detect it here being cleared first. + resp = get_stored_msg( "_vsav-persistence_" ) + return resp == "" or resp.startswith( "ERROR:" ) + wait_for( 2, check_response ) # wait for the updated data to come back timeout = 120 if os.name == "nt" else 60