Await until the specified command becomes success