Skip to content

Commit

Permalink
Increase delay in BmiClientSubProcess tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sverhoeven committed Oct 26, 2023
1 parent 4333f13 commit 7c29974
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions grpc4bmi/bmi_client_subproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ class BmiClientSubProcess(BmiClient):
>>> mymodel = BmiClientSubProcess(<PACKAGE>.<MODULE>.<CLASS>)
"""

def __init__(self, module_name, path=None, timeout=None):
def __init__(self, module_name, path=None, timeout=None, delay=1):
host = "localhost"
port = BmiClient.get_unique_port(host)
name_options = ["--name", module_name]
port_options = ["--port", str(port)]
path_options = ["--path", path] if path else []
self.pipe = subprocess.Popen(["run-bmi-server"] + name_options + port_options + path_options, env=dict(os.environ))
time.sleep(1)
time.sleep(delay)
super(BmiClientSubProcess, self).__init__(BmiClient.create_grpc_channel(port=port, host=host), timeout=timeout)

def __del__(self):
Expand Down
2 changes: 1 addition & 1 deletion test/test_subproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
def make_bmi_classes(init=False):
numpy.random.seed(0)
os.environ["PYTHONPATH"] = os.path.dirname(os.path.abspath(__file__))
client = BmiClientSubProcess("heat.BmiHeat", timeout=10)
client = BmiClientSubProcess("heat.BmiHeat", timeout=10, delay=3)
local = BmiHeat()
if init:
client.initialize(None)
Expand Down

0 comments on commit 7c29974

Please sign in to comment.