pub struct TestController<'test_refs> { /* private fields */ }
Expand description
test_server_client
and test_client
allow for a “coordinator” closure - something
responsible for coordinating test execution. In particular in certain tests it is important to
make sure all the operations have completed before running the next portion of the test.
This type represents a controller that the coordinator uses to achieve this effect.
Coordinator will use oneshot
or mpsc
channels to synchronize with the test execution and
will call TestController::run_until_stalled()
to separate portions of the test, optinally
followed by TestController::run_until_complete()
. In any case, TestController
will
ensure that the test execution
finishes completely, not just stalls.
Implementations§
Source§impl<'test_refs> TestController<'test_refs>
impl<'test_refs> TestController<'test_refs>
Sourcepub fn run_until_stalled(&mut self)
pub fn run_until_stalled(&mut self)
Runs the client test code until it is stalled. Will panic if the test code runs to completion.
Sourcepub fn run_until_complete(self)
pub fn run_until_complete(self)
Runs the client test code to completion. As this will consume the controller, this method can only be called last. Note that the controller will effectively run this methods for you when it is dropped, if you do not do it explicitly.