tirkarthi commented on issue #22869:
URL: https://github.com/apache/airflow/issues/22869#issuecomment-1093698834
Probably something like below could be added as a test case :
```python
def test_clear_taskinstance_is_called_with_invalid_task_ids(self, session):
"""Test that dagrun is running when invalid task_ids are passed to
clearTaskInstances API."""
dag_id = "example_python_operator"
tis = self.create_task_instances(session)
dagrun = tis[0].get_dagrun()
assert dagrun.state == 'running'
payload = {"dry_run": False, "reset_dag_runs": True, "task_ids": [""]}
self.app.dag_bag.sync_to_db()
response = self.client.post(
f"/api/v1/dags/{dag_id}/clearTaskInstances",
environ_overrides={"REMOTE_USER": "test"},
json=payload,
)
assert response.status_code == 200
dagrun.refresh_from_db()
assert dagrun.state == 'running'
assert all(ti.state == 'running' for ti in tis
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]