Skip to content

Commit 85bc0c5

Browse files
authored
[v3-0-test] Fix flaky timeout test by using relative start_time calculation (#54641) (#54699)
1 parent bc01259 commit 85bc0c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

airflow-core/tests/unit/dag_processing/test_manager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,9 @@ def test_scan_stale_dags(self, testing_dag_bundle):
520520

521521
def test_kill_timed_out_processors_kill(self):
522522
manager = DagFileProcessorManager(max_runs=1, processor_timeout=5)
523-
processor, _ = self.mock_processor(start_time=16000)
523+
# Set start_time to ensure timeout occurs: start_time = current_time - (timeout + 1) = always (timeout + 1) seconds
524+
start_time = time.monotonic() - manager.processor_timeout - 1
525+
processor, _ = self.mock_processor(start_time=start_time)
524526
manager._processors = {
525527
DagFileInfo(
526528
bundle_name="testing", rel_path=Path("abc.txt"), bundle_path=TEST_DAGS_FOLDER

0 commit comments

Comments
 (0)