code: def wait_for_success(self, interval=1):
          
  
          self.wait_for_completion(interval=interval)
  
          if not self.is_successful(retry=True):
              for task_name, task in six.iteritems(self.get_task_statuses()):
                  exc = None
                  if task.status == Instance.Task.TaskStatus.FAILED:
                      exc = errors.parse_instance_error(self.get_task_result(task_name))
                  elif task.status != Instance.Task.TaskStatus.SUCCESS:
                      exc = errors.ODPSError('%s, status=%s' % (task_name, task.status.value))
                  if exc:
                      exc.instance_id = self.id
                      raise exc
docs: Wait for instance to complete, and check if the instance is successful.
  
          :param interval: time interval to check
          :return: None
          :raise: :class:`odps.errors.ODPSError` if the instance failed