Skip to content

Commit 7cb8421

Browse files
committed
Impovements in FE e2e script
It could happen that npm script for runing test can hang and hence some resources may not be freed properly. This patch adds timeout for npm script and make sure that process will be killed. Change-Id: I0694ff71aad885564ae0591ec003722babd235a4
1 parent a297327 commit 7cb8421

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

gui/frontend/src/tests/e2e/setup_local_env_and_run.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@
8888
MAX_WORKERS = "3"
8989
TOKEN = "1234test"
9090

91+
TESTS_TIMEOUT = 30*60
92+
9193
class SetEnvironmentVariablesTask:
9294
"""Task for setting environment variables"""
9395

@@ -157,7 +159,13 @@ def run(self) -> None:
157159

158160
e2e_tests = subprocess.Popen(args=args, env=self.environment)
159161
e2e_tests.communicate()
160-
return_code = e2e_tests.wait()
162+
163+
try:
164+
return_code = e2e_tests.wait(timeout=TESTS_TIMEOUT)
165+
except subprocess.TimeoutExpired:
166+
e2e_tests.kill()
167+
return_code = -1
168+
161169
if return_code != 0:
162170
raise task_utils.TaskFailException("Tests failed")
163171

0 commit comments

Comments
 (0)