Skip to content

p2p test framework : detached process improvement

Fixes: https://gitlab.com/nomadic-labs/tezos/-/issues/132

Currently lib_p2p/test contains a test framework that allows to fork a given number of process that execute a given function in a separated system thread.

This is used to run connections and communications between simplified p2p pools, with fine grain control over the network topology and the order of the messages.

The issue addressed here is that the detached process can only return error code, not the return value of the function executed this lead to a poor UX for people writting test with this framework.

This MR adds a channel from the process in which the result of the executed function is pushed at the end of the run, before stopping the thread. Further more it permit to optionaly specify data encoding for values exchanged with the process. It is optional to quicken the writing of test when exchanged values can be exchange easily through marshalling, but it should be used whenever an extensible type is exchanged.

This branche is based on @romain.nl work to allow the registering of recursive error kind: !1770 (merged)

An addendum to this MR, !1892 (closed), provides a better handling of parallel errors.

Edited by Julien

Merge request reports