return deferred from callbacks in functional tests