@@ -856,7 +856,7 @@ def run(self) -> int:
856856
857857 cmdl = self .get_cmd ()
858858
859- logger .debug ("Run OM command %s in %s" , repr (cmdl ), self .cmd_path )
859+ logger .debug ("Run OM command %s in %s (timeout=%2fs) " , repr (cmdl ), self .cmd_path , self . cmd_timeout )
860860 try :
861861 cmdres = subprocess .run (
862862 cmdl ,
@@ -876,7 +876,8 @@ def run(self) -> int:
876876 if stderr :
877877 raise ModelExecutionException (f"Error running model executable { repr (cmdl )} : { stderr } " )
878878 except subprocess .TimeoutExpired as ex :
879- raise ModelExecutionException (f"Timeout running model executable { repr (cmdl )} : { ex } " ) from ex
879+ raise ModelExecutionException ("OMPython timeout running model executable "
880+ f"(timeout={ self .cmd_timeout :.2f} s){ repr (cmdl )} : { ex } " ) from ex
880881 except subprocess .CalledProcessError as ex :
881882 raise ModelExecutionException (f"Error running model executable { repr (cmdl )} : { ex } " ) from ex
882883
@@ -1282,7 +1283,7 @@ def sendExpression(self, expr: str, parsed: bool = True) -> Any:
12821283 log_content = 'log not available'
12831284
12841285 logger .error (f"OMC did not start. Log-file says:\n { log_content } " )
1285- raise OMCSessionException (f"No connection with OMC (timeout={ self ._timeout } )." )
1286+ raise OMCSessionException (f"No connection with OMC (timeout={ self ._timeout :.2f } s )." )
12861287
12871288 if expr == "quit()" :
12881289 self ._omc_zmq .close ()
@@ -1509,7 +1510,7 @@ def _omc_port_get(self) -> str:
15091510 break
15101511 else :
15111512 logger .error (f"OMC server did not start. Log-file says:\n { self .get_log ()} " )
1512- raise OMCSessionException (f"OMC Server did not start (timeout={ self ._timeout } , "
1513+ raise OMCSessionException (f"OMC Server did not start (timeout={ self ._timeout :.2f } s , "
15131514 f"logfile={ repr (self ._omc_logfile )} )." )
15141515
15151516 logger .info (f"Local OMC Server is up and running at ZMQ port { port } "
@@ -1648,7 +1649,7 @@ def _docker_process_get(self, docker_cid: str) -> Optional[DockerPopen]:
16481649 break
16491650 else :
16501651 logger .error (f"Docker did not start. Log-file says:\n { self .get_log ()} " )
1651- raise OMCSessionException (f"Docker based OMC Server did not start (timeout={ self ._timeout } )." )
1652+ raise OMCSessionException (f"Docker based OMC Server did not start (timeout={ self ._timeout :.2f } s )." )
16521653
16531654 return docker_process
16541655
@@ -1698,7 +1699,7 @@ def _omc_port_get(
16981699 break
16991700 else :
17001701 logger .error (f"Docker did not start. Log-file says:\n { self .get_log ()} " )
1701- raise OMCSessionException (f"Docker based OMC Server did not start (timeout={ self ._timeout } , "
1702+ raise OMCSessionException (f"Docker based OMC Server did not start (timeout={ self ._timeout :.2f } s , "
17021703 f"logfile={ repr (self ._omc_logfile )} )." )
17031704
17041705 logger .info (f"Docker based OMC Server is up and running at port { port } " )
@@ -1882,10 +1883,9 @@ def _docker_omc_start(
18821883 pass
18831884 if docker_cid is not None :
18841885 break
1885- time .sleep (self ._timeout / 40.0 )
18861886
18871887 if docker_cid is None :
1888- raise OMCSessionException (f"Docker did not start (timeout={ self ._timeout } might be too short "
1888+ raise OMCSessionException (f"Docker did not start (timeout={ self ._timeout :.2f } s might be too short "
18891889 "especially if you did not docker pull the image before this command). "
18901890 f"Log-file says:\n { self .get_log ()} " )
18911891
@@ -2076,7 +2076,7 @@ def _omc_port_get(self) -> str:
20762076 break
20772077 else :
20782078 logger .error (f"WSL based OMC server did not start. Log-file says:\n { self .get_log ()} " )
2079- raise OMCSessionException (f"WSL based OMC Server did not start (timeout={ self ._timeout } , "
2079+ raise OMCSessionException (f"WSL based OMC Server did not start (timeout={ self ._timeout :2f } s , "
20802080 f"logfile={ repr (self ._omc_logfile )} )." )
20812081
20822082 logger .info (f"WSL based OMC Server is up and running at ZMQ port { port } "
0 commit comments