This repository has been archived by the owner on May 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
do not create thread if tests_per_worker==1 #96
Comments
tovmeod
added a commit
to tovmeod/pytest-parallel
that referenced
this issue
Apr 26, 2021
andrea-segalini
pushed a commit
to andrea-segalini/pytest-parallel
that referenced
this issue
Feb 13, 2024
Avoid creating a thread when there is one worker. This allows benefitting from signal-based communication with the test workers when threads are not used (e.g., for timeouts as in solves kevlened#96)
andrea-segalini
pushed a commit
to andrea-segalini/pytest-parallel
that referenced
this issue
Feb 13, 2024
Avoid creating a thread when there is one worker. This allows benefitting from signal-based communication with the test workers when threads are not used (e.g., for timeouts as in solves kevlened#96)
andrea-segalini
pushed a commit
to andrea-segalini/pytest-parallel
that referenced
this issue
Feb 13, 2024
Avoid creating a thread when there is one worker. This allows benefitting from signal-based communication with the test workers when threads are not used (e.g., for timeouts as in solves kevlened#96)
andrea-segalini
pushed a commit
to andrea-segalini/pytest-parallel
that referenced
this issue
Feb 13, 2024
Avoid creating a thread when there is one worker. This allows benefitting from signal-based communication with the test workers when threads are not used (e.g., for timeouts as in solves kevlened#96)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have some tests using signal and I get"
`
signalnum = <Signals.SIGINT: 2>
handler =
E ValueError: signal only works in main thread`
To solve this I propose to not use a ThreadWorker if tests_per_worker==1 and just run it directly
we can use the following instead of process_with_threads:
`
def process_with_one_thread(config, queue, session, tests_per_worker, errors):
# This function will be called from subprocesses, forked from the main
# pytest process. First thing we need to do is to change config's value
# so we know we are running as a worker.
config.parallel_worker = True
`
The text was updated successfully, but these errors were encountered: