Skip to content

Commit

Permalink
Chatching errors in init_multiprocessing
Browse files Browse the repository at this point in the history
  • Loading branch information
anibalinn committed Sep 17, 2024
1 parent 38478fa commit 9301578
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
21 changes: 12 additions & 9 deletions behavex/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,18 @@ def setup_running_failures(args_parsed):


def init_multiprocessing(idQueue, parallel_delay):
"""Initialize multiprocessing by ignoring SIGINT signals."""
signal.signal(signal.SIGINT, signal.SIG_IGN)
# Retrieve one of the unique IDs
worker_id = idQueue.get()
# Use the unique ID to name the process
multiprocessing.current_process().name = f'behave_worker-{worker_id}'
# Add delay
if parallel_delay > 0:
time.sleep(parallel_delay / 1000.0)
try:
signal.signal(signal.SIGINT, signal.SIG_IGN)
# Retrieve one of the unique IDs
worker_id = idQueue.get()
# Use the unique ID to name the process
multiprocessing.current_process().name = f'behave_worker-{worker_id}'
# Add an initial delay to avoid all processes starting at the same time
if parallel_delay > 0:
time.sleep(parallel_delay / 1000.0)
except Exception as e:
logging.error(f"Exception in init_multiprocessing: {e}")
raise


def launch_behavex():
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"

[project]
name = "behavex"
version = "4.0.4rc1"
description = "Agile test wrapper on top of Behave (BDD)."
version = "4.0.4rc2"
description = "Agile testing framework on top of Behave (BDD)."
readme = "README.md"
license = { text = "MIT" }
authors = [
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='behavex',
version='4.0.4rc1',
version='4.0.4rc2',
license="MIT",
platforms=['any'],
python_requires='>=3.5',
Expand All @@ -15,7 +15,7 @@
url='https://github.com/hrcorval/behavex',
packages=find_packages(exclude=['tests']),
include_package_data=True,
description='Agile test wrapper on top of Behave (BDD).',
description='Agile testing framework on top of Behave (BDD).',
long_description_content_type='text/markdown',
long_description=long_description,
entry_points={
Expand Down

0 comments on commit 9301578

Please sign in to comment.