Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autotest: fix early return and result checking #574

Merged
merged 1 commit into from
Oct 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 7 additions & 16 deletions dpgen/auto_test/common_prop.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def run_property(confs,
conf_dirs.sort()
task_list = []
work_path_list = []
multiple_ret = []
for ii in conf_dirs:
sepline(ch=ii, screen=True)
for jj in property_list:
Expand Down Expand Up @@ -159,7 +160,7 @@ def run_property(confs,
all_task = tmp_task_list
run_tasks = util.collect_task(all_task, inter_type)
if len(run_tasks) == 0:
return
continue
else:
ret = pool.apply_async(worker, (work_path,
all_task,
Expand All @@ -169,23 +170,13 @@ def run_property(confs,
mdata,
inter_type,
))
# run_tasks = [os.path.basename(ii) for ii in all_task]
# machine, resources, command, group_size = util.get_machine_info(mdata, inter_type)
# disp = make_dispatcher(machine, resources, work_path, run_tasks, group_size)
# disp.run_jobs(resources,
# command,
# work_path,
# run_tasks,
# group_size,
# forward_common_files,
# forward_files,
# backward_files,
# outlog='outlog',
# errlog='errlog')
multiple_ret.append(ret)
pool.close()
pool.join()
if ret.successful():
print('finished')
for ii in range(len(multiple_ret)):
if not multiple_ret[ii].successful():
raise RuntimeError("Job %d is not successful!" % ii)
print('%d jobs are finished' % len(multiple_ret))


def worker(work_path,
Expand Down