wazuh / qa-system-framework

GNU General Public License v2.0
1 stars 3 forks source link

Add custom threading module and tests #15

Closed jmv74211 closed 1 year ago

jmv74211 commented 1 year ago
Related issue
#8

This PR adds a new module to manage custom threads.

The motivation of this new "wrapper" class is that when an exception occurs in a thread in Python, this exception is not automatically propagated to the parent process, since threads share the same memory space and the exception may occur in a different context than the parent process. Instead, you must catch the exception within the thread and communicate it to the parent process somehow.

This new class allows us to get the thread exception and raise it to the parent process when doing the join. In addition, I have added two unit tests to check that it works properly.