-# Copyright (C) 2013-2016 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
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()
#
if __name__ == "__main__":
- if not os.path.isfile("hello.py"):
- with open("hello.py", "w") as f:
- f.write("print('Hello!')")
-
unittest.main()
#