From b2e414d7f42ab3de864a7819772d8ad1f7347e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Berland?= Date: Fri, 6 Oct 2023 15:12:51 +0200 Subject: [PATCH] Rerun when license server flakyness is detected (#614) Only applies to the Eclipse reservoir simulator. --- tests/test_check_swatinit_simulators.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_check_swatinit_simulators.py b/tests/test_check_swatinit_simulators.py index a6c08e106..89a1f993a 100644 --- a/tests/test_check_swatinit_simulators.py +++ b/tests/test_check_swatinit_simulators.py @@ -10,6 +10,7 @@ import os import subprocess +import time from pathlib import Path import ecl2df @@ -60,9 +61,22 @@ def run_reservoir_simulator(simulator, resmodel, perform_qc=True): simulator_option = ["-i"] if "flow" in simulator: simulator_option = ["--parsing-strictness=low"] + result = subprocess.run( # pylint: disable=subprocess-run-check [simulator] + simulator_option + ["FOO.DATA"], stdout=subprocess.PIPE ) + + if ( + result.returncode != 0 + and "runeclipse" in simulator + and "LICENSE FAILURE" in result.stdout.decode() + result.stderr.decode() + ): + print("Eclipse failed due to license server issues. Retrying in 30 seconds.") + time.sleep(30) + result = subprocess.run( # pylint: disable=subprocess-run-check + [simulator] + simulator_option + ["FOO.DATA"], stdout=subprocess.PIPE + ) + if result.returncode != 0: if result.stdout: print(result.stdout.decode())