Add missing wait in tests