Skip to content

Commit 7f71cdf

Browse files
committed
Added timeout on installer tests
1 parent 7ccf3da commit 7f71cdf

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tests/msi/helpers.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,15 @@ def read_config(config_file):
6868
def install(msi_file, target_folder, command_line):
6969
command_line = list(map(lambda x: x.replace("$MSI-FILE", msi_file), command_line))
7070
print(f"- Installing NSClient++: {' '.join(command_line)}", flush=True)
71-
process = run(command_line)
72-
if process.returncode == 0:
73-
print("- Installation completed successfully.", flush=True)
74-
else:
75-
print(f"! The exit code was: {process.returncode}", flush=True)
76-
exit(1)
71+
try:
72+
process = run(command_line, timeout=120)
73+
if process.returncode == 0:
74+
print("- Installation completed successfully.", flush=True)
75+
else:
76+
print(f"! The exit code was: {process.returncode}", flush=True)
77+
exit(1)
78+
except Exception as e:
79+
print(f"! Install failed: {e}", flush=True)
7780

7881
if path.exists(target_folder) and path.isdir(target_folder) and path.exists(path.join(target_folder, "nscp.exe")):
7982
print(f"- Installation seems successfully: {target_folder}", flush=True)

0 commit comments

Comments
 (0)