Function postgresfixture::coordinate::run_and_stop
source · pub fn run_and_stop<'a, F, T>(
cluster: &'a Cluster,
lock: UnlockedFile,
action: F
) -> Result<T, ClusterError>
Expand description
Perform action
in cluster
.
Using the given lock for synchronisation, this creates the cluster if it
does not exist, starts it if it’s not running, performs the action
, then
(maybe) stops the cluster again, and finally returns the result of action
.
If there are other users of the cluster – i.e. if an exclusive lock cannot
be acquired during the shutdown phase – then the cluster is left running.