Skip to content

Commit

Permalink
Improvement done when closing the ProcessPoolExecutor handler
Browse files Browse the repository at this point in the history
  • Loading branch information
anibalinn committed Aug 30, 2024
1 parent f15ac2a commit 8525e8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions behavex/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,14 +741,16 @@ def wrap_up_process_pools(process_pool,
output = os.path.join(get_env('OUTPUT'))
try:
process_pool.shutdown(wait=True)
except Exception as ex:
if process_pool.is_alive():
process_pool.shutdown(wait=False, cancel_futures=True)
if json_reports:
if type(json_reports) is list:
if scenario:
json_reports = join_scenario_reports(json_reports)
merged_json = join_feature_reports(json_reports)
else:
merged_json = json_reports
except KeyboardInterrupt:
process_pool.shutdown(wait=False, cancel_futures=True)
if global_vars.progress_bar_instance:
global_vars.progress_bar_instance.finish()
status_info = os.path.join(output, global_vars.report_filenames['report_overall'])
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='behavex',
version='4.0.1rc10',
version='4.0.1rc11',
license="MIT",
platforms=['any'],
python_requires='>=3.5',
Expand Down

0 comments on commit 8525e8d

Please sign in to comment.