testhelper: Introduce function to easily receive from streaming RPCs
The logic required to read a streaming RPC until we hit its end is comparatively complex and not exactly pretty. Many of our tests get it wrong, which leads to cases where we don't properly check for error conditions.
Introduce two new test helpers Receive()
and ReceiveAndFold()
that
allow the caller to receive all results as well as any potential error
code and optionally fold the results in order to convert them. Convert
our tests to use these helpers.