kaxil commented on a change in pull request #18338:
URL: https://github.com/apache/airflow/pull/18338#discussion_r711561784
##########
File path: tests/jobs/test_local_task_job.py
##########
@@ -740,13 +740,17 @@ def
test_mini_scheduler_works_with_wait_for_upstream(self, caplog, dag_maker):
job1 = LocalTaskJob(task_instance=ti2_a, ignore_ti_state=True,
executor=SequentialExecutor())
job1.task_runner = StandardTaskRunner(job1)
job1.run()
- ti2_a.refresh_from_db()
+ session.flush()
+ ti2_a.refresh_from_db(session)
+ ti2_b.refresh_from_db(session)
assert ti2_a.state == State.SUCCESS
assert ti2_b.state == State.NONE
Review comment:
Indeed, there a bit of an anit-pattern
##########
File path: tests/jobs/test_local_task_job.py
##########
@@ -740,13 +740,17 @@ def
test_mini_scheduler_works_with_wait_for_upstream(self, caplog, dag_maker):
job1 = LocalTaskJob(task_instance=ti2_a, ignore_ti_state=True,
executor=SequentialExecutor())
job1.task_runner = StandardTaskRunner(job1)
job1.run()
- ti2_a.refresh_from_db()
+ session.flush()
+ ti2_a.refresh_from_db(session)
+ ti2_b.refresh_from_db(session)
assert ti2_a.state == State.SUCCESS
assert ti2_b.state == State.NONE
Review comment:
Indeed, they are a bit of an anit-pattern
--
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]