Skip to content

Commit

Permalink
Rerun when license server flakyness is detected (#614)
Browse files Browse the repository at this point in the history
Only applies to the Eclipse reservoir simulator.
  • Loading branch information
berland authored Oct 6, 2023
1 parent 372b1e9 commit b2e414d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_check_swatinit_simulators.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import os
import subprocess
import time
from pathlib import Path

import ecl2df
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit b2e414d

Please sign in to comment.