Dispatch functions run async code synchronous in tests