introduce convenience function wait_for_alert