fix unit test so uses latches and observable subscription to wait for completion