def METHOD_NAME(self):
    pipeline_run = create_and_start_pipeline_run(
        self.pipeline,
        self.pipeline_schedule,
        dict(variables=dict(mage=3)),
    )
    error = False
    try:
        check_pipeline_run_status(pipeline_run, poll_interval=1, poll_timeout=1)
    except Exception:
        error = True
    self.assertTrue(error)
    pipeline_run.status = PipelineRun.PipelineRunStatus.FAILED
    pipeline_run.save()
    error = False
    try:
        check_pipeline_run_status(pipeline_run, error_on_failure=True)
    except Exception as err:
        error = True
        self.assertEqual(
            f'Pipeline run {pipeline_run.id} for pipeline {self.pipeline.uuid}: failed.',
            str(err),
        )
    self.assertTrue(error)
    pipeline_run.status = PipelineRun.PipelineRunStatus.CANCELLED
    pipeline_run.save()
    check_pipeline_run_status(pipeline_run, error_on_failure=True)
    pipeline_run.status = PipelineRun.PipelineRunStatus.COMPLETED
    pipeline_run.save()
    check_pipeline_run_status(pipeline_run, error_on_failure=True)