kevlened / pytest-parallel

A pytest plugin for parallel and concurrent testing
https://github.com/browsertron/pytest-parallel/issues/104#issuecomment-1293941066
MIT License
313 stars 59 forks source link

Runs with dynamically predefined thread names are sticks #106

Open boris-becker-p opened 2 years ago

boris-becker-p commented 2 years ago

I would like to set thread name dynamically like :

pytest_parallel/__init__.py
.....
import time 

class ThreadWorker(threading.Thread):
    def __init__(self, queue, session, errors):
        _name = "Thread_" + str(time.time())
        threading.Thread.__init__(self, name=_name)
        self.queue = queue
        self.session = session
        self.errors = errors
.....

But it is always stucks on Ubuntu. What is the right way to set the thread name? Can you help please?