ashb commented on code in PR #55563:
URL: https://github.com/apache/airflow/pull/55563#discussion_r2344117112


##########
airflow-core/tests/unit/jobs/test_triggerer_job.py:
##########
@@ -270,25 +270,31 @@ def send_msg_spy(self, msg, *args, **kwargs):
 
 @pytest.mark.parametrize(
     "trigger, watcher_count, trigger_count",
-    [(TimeDeltaTrigger(datetime.timedelta(days=7)), 0, 1), 
(FileDeleteTrigger("/tmp/foo.txt"), 1, 0)],
+    [
+        (TimeDeltaTrigger(datetime.timedelta(days=7)), 0, 1),
+        (FileDeleteTrigger("/tmp/foo.txt", poke_interval=1), 1, 0),
+    ],
 )
 @patch("time.monotonic", side_effect=itertools.count(start=1, step=60))
 def test_trigger_log(mock_monotonic, trigger, watcher_count, trigger_count, 
session, capsys):
     """
     Checks that the triggerer will log watcher and trigger in separate lines.
     """
-    create_trigger_in_db(session, trigger)
+    _, _, trigger_orm, _ = create_trigger_in_db(session, trigger)
 
-    trigger_runner_supervisor = 
TriggerRunnerSupervisor.start(job=Job(id=12345), capacity=10)
+    trigger_runner_supervisor = 
TriggerRunnerSupervisor.start(job=Job(id=123456), capacity=10)
     trigger_runner_supervisor.load_triggers()
 
-    for _ in range(10):
+    for _ in range(30):
         trigger_runner_supervisor._service_subprocess(0.1)
 
     stdout = capsys.readouterr().out
     assert f"{trigger_count} triggers currently running" in stdout
     assert f"{watcher_count} watchers currently running" in stdout
 
+    session.delete(trigger_orm)
+    session.commit()

Review Comment:
   Rather than adding this here, we should probably update the autoused 
`clean_database` fixture in this file



-- 
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]

Reply via email to