Skip to content

Commit a889dd9

Browse files
author
Jakub Klimczak
committed
[#92470] manager: Report errors in config through webui
1 parent 878fe01 commit a889dd9

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

protoplaster/runner/manager.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from threading import Lock
33
from .metadata import new_run_metadata, RunStatus
44
from .worker import run_test
5-
from .runner import run_tests
5+
from .runner import create_test_file, run_tests
66
from datetime import datetime, timezone
77
from email.utils import format_datetime
88
from copy import deepcopy
@@ -31,13 +31,25 @@ def handle_run_request(self,
3131
check_args.group = test_suite_name
3232
check_args.overrides = overrides
3333

34+
try:
35+
create_test_file(check_args)
36+
except Exception as e:
37+
return {"error": str(e)}
38+
3439
# Generate a "tracked" run when it is a result of a remote dispatch.
3540
if machine_target:
3641
return self.create_run(config_name, test_suite_name, base_args,
3742
machine_target, overrides)
3843

39-
# Ochestrator node execution.
40-
self.executor.submit(run_tests, check_args)
44+
def on_done(f):
45+
try:
46+
f.result()
47+
except Exception as e:
48+
print(f"Run failed: {e}")
49+
50+
# Orchestrator node execution.
51+
future = self.executor.submit(run_tests, check_args)
52+
future.add_done_callback(on_done)
4153
return None
4254

4355
def create_run(self,

0 commit comments

Comments
 (0)