Salome HOME
Copyright update 2020
[modules/kernel.git] / bin / appliskel / tests / concurrentSession / TestConcurrentSession.py
old mode 100644 (file)
new mode 100755 (executable)
index 59ff65c..cda7592
@@ -1,4 +1,5 @@
-# Copyright (C) 2013-2017  CEA/DEN, EDF R&D, OPEN CASCADE
+#!/usr/bin/env python3
+# Copyright (C) 2013-2020  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -44,7 +45,10 @@ class TestConcurrentLaunch(unittest.TestCase):
     return running_instances, processes
   #
   def __terminateInstances(self, running_instances):
-    while not running_instances.empty():
+    import time
+    timeout = time.time() + 60*10 # the test duration is about 50 s, we reasonably assume a max duration of 10mn
+
+    while not running_instances.empty() and time.time() < timeout:
       instance = running_instances.get()
       print("Terminate instance running on port", instance.get_port())
       instance.stop()