Python testing tool for complex multiprocessing & multithreading fuzzy testing

The background:

My team needs to test a distributed protocol implementation (Eg: RAFT algorithm), the implementation is based on a rpc layer(Eg: grpc), We have implemented a mocked rpc layer based on utils provided by the multiprocessing library, and we may perform operations such as reorder, drop, delay to simulate real network environments. The mock library is used to inject simulated functions. We spawn subprocesses as agents in the distributed protocol.

Current testing harness:

We are using pytest as our major framework, pytest is great for single thread testing, but not appropriate for this scenario, because exceptions cannot be caught in threads / processes spawned by the tested function. We have tried to create runners which can capture exceptions and send exceptions back and reraise:

result = [None, None, None]
    finished = [False, False, False]
    while not all(finished):
        for p, pi, i in zip(procs, proc_pipes, [0, 1, 2]):
            if pi.poll(timeout=1e-3):
                status, r = pi.recv()
                if status:
                    finished[i] = True
                    result[i] = r
                else:
                    raise r
    return result

But this method is only sufficient for capturing exceptions thrown by agent processes created during testing (Eg: created with pytest.fixture), and cannot monitor exceptions thrown in background threads spawned in the algorithm.

Some requirements:

If there is a tool other than pytest designed specifically for testing distributed program, that would be the best.

If there doesn't exist such a tool, then we wish to find a pytest plugin which can monitor threads & processes spawned during test execution, it would be best if it comes with a filter function to ignore some exceptions.

If that is not possible, then it should terminate the test immediately if any exception is thrown in any threads/processes, we will use other logging tools to capture the execution process.

Thanks for your generous help!