XD-2367 Add waitForCompletion to fix failing test in CI environment