ashb commented on code in PR #46677:
URL: https://github.com/apache/airflow/pull/46677#discussion_r1956796995
##########
tests/jobs/test_triggerer_job.py:
##########
@@ -483,218 +411,127 @@ def handle_events(self):
session.commit()
- job = Job()
- job_runner = TriggererJob_(job)
- job_runner.trigger_runner = TriggerRunner_()
- thread = Thread(target=job_runner._execute)
- thread.start()
- try:
- for _ in range(40):
- time.sleep(0.1)
- # ready to evaluate after 2 loops
- if getattr(job_runner.trigger_runner, "loop_count", 0) >= 2:
- break
- else:
- pytest.fail("did not observe 2 loops in the runner thread")
- finally:
- job_runner.trigger_runner.stop = True
- job_runner.trigger_runner.join(30)
- thread.join()
- instances = path.read_text().splitlines()
- assert len(instances) == 1
+ supervisor = supervisor_builder()
+ iteration = 0
-def test_trigger_from_dead_triggerer(session, create_task_instance):
Review Comment:
`test_trigger_from_dead_triggerer` and `test_trigger_from_expired_triggerer`
are both duplicated tests that already exist here
https://github.com/apache/airflow/blob/1b68875d6b6c8ae8167c97d8645ec4d0ea922c14/tests/models/test_trigger.py#L270-L367
The code inside TriggererJob was to just call the model function, so I
decided there was no point testing it twice.
--
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]