Add a wait helper
Fix pool tests with the wait helper