From af4980594d69b0779f9ac77e4e86132d56afba66 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 24 Sep 2020 12:28:02 +0300 Subject: [PATCH] bos #19241 Prevent shaper tests hanging up --- bin/runSalome.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/runSalome.py b/bin/runSalome.py index a5997a2b1..41eb05b03 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -855,10 +855,12 @@ def foreGround(clt, args): dt = 0.1 nbtot = 100 nb = 0 + session_pid = None while 1: try: status = session.GetStatSession() gui_detected = status.activeGUI + session_pid = session.getPID() except: pass if gui_detected: @@ -878,9 +880,9 @@ def foreGround(clt, args): # -- server = Server({}) if sys.platform == "win32": - server.CMD = [os.getenv("PYTHONBIN"), "-m", "killSalomeWithPort", "--spy", "%s"%(os.getpid()), "%s"%(port)] + server.CMD = [os.getenv("PYTHONBIN"), "-m", "killSalomeWithPort", "--spy", "%s"%(session_pid or os.getpid()), "%s"%(port)] else: - server.CMD = ["killSalomeWithPort.py", "--spy", "%s"%(os.getpid()), "%s"%(port)] + server.CMD = ["killSalomeWithPort.py", "--spy", "%s"%(session_pid or os.getpid()), "%s"%(port)] server.run() # os.system("killSalomeWithPort.py --spy %s %s &"%(os.getpid(), port)) # -- @@ -922,7 +924,7 @@ def runSalome(): except: pass # -- - test = test and os.getenv("SALOME_TEST_MODE", "0") != "1" +# test = test and os.getenv("SALOME_TEST_MODE", "0") != "1" test = test and args['foreground'] # -- if test: -- 2.39.2