Polls the provided stream
and expects a non-null item to be produced.
Polls the provided stream
and expects that it is Pending (e.g no stream items).
Polls the provided stream
and expects that it is terminated (e.g. returns None).
! Utilities for tests
Run a background task while waiting for a future that should occur.
This is useful for running a task which you expect to produce side effects that
mean the task is operating correctly. i.e. reacting to a peer action by producing a
response on a client’s hanging get.
background_fut
is expected not to finish ans is returned to the caller, along with
the result of result_fut
. If background_fut
finishes, this function will panic.