You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by mo...@apache.org on 2024/06/05 21:24:31 UTC
(airflow) branch openlineage-process-execution updated (449dd3c671 -> 2a1c57a346)
This is an automated email from the ASF dual-hosted git repository.
mobuchowski pushed a change to branch openlineage-process-execution
in repository https://gitbox.apache.org/repos/asf/airflow.git
discard 449dd3c671 openlineage: execute extraction and message sending in separate process
new 2a1c57a346 openlineage: execute extraction and message sending in separate process
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (449dd3c671)
\
N -- N -- N refs/heads/openlineage-process-execution (2a1c57a346)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
airflow/providers/common/sql/operators/sql.py | 6 -
.../providers/google/cloud/openlineage/utils.py | 4 +
airflow/providers/openlineage/conf.py | 16 +-
airflow/providers/openlineage/plugins/listener.py | 16 +-
airflow/providers/openlineage/provider.yaml | 11 +-
airflow/providers/openlineage/sqlparser.py | 20 +--
airflow/providers/openlineage/utils/sql.py | 12 +-
airflow/providers/openlineage/utils/utils.py | 3 +-
generated/provider_dependencies.json | 4 +-
tests/dags/test_openlineage_execution.py | 60 +++++++
.../openlineage/plugins/test_execution.py | 187 +++++++++++++++++++++
11 files changed, 298 insertions(+), 41 deletions(-)
create mode 100644 tests/dags/test_openlineage_execution.py
create mode 100644 tests/providers/openlineage/plugins/test_execution.py
(airflow) 01/01: openlineage: execute extraction and message sending in separate process
Posted by mo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mobuchowski pushed a commit to branch openlineage-process-execution
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 2a1c57a34621a848e75d5f3642e9c60936fcee9b
Author: Maciej Obuchowski <ob...@gmail.com>
AuthorDate: Fri May 31 14:47:28 2024 +0200
openlineage: execute extraction and message sending in separate process
Signed-off-by: Maciej Obuchowski <ob...@gmail.com>
---
.../providers/google/cloud/openlineage/utils.py | 4 +
airflow/providers/openlineage/conf.py | 16 +-
airflow/providers/openlineage/plugins/listener.py | 40 ++++-
airflow/providers/openlineage/provider.yaml | 11 +-
airflow/providers/openlineage/sqlparser.py | 16 +-
airflow/providers/openlineage/utils/sql.py | 6 +
airflow/providers/snowflake/hooks/snowflake.py | 6 +-
generated/provider_dependencies.json | 4 +-
tests/dags/test_openlineage_execution.py | 60 +++++++
.../openlineage/plugins/test_execution.py | 187 +++++++++++++++++++++
10 files changed, 335 insertions(+), 15 deletions(-)
diff --git a/airflow/providers/google/cloud/openlineage/utils.py b/airflow/providers/google/cloud/openlineage/utils.py
index fb0d4c663b..986bf62f62 100644
--- a/airflow/providers/google/cloud/openlineage/utils.py
+++ b/airflow/providers/google/cloud/openlineage/utils.py
@@ -163,9 +163,13 @@ def get_from_nullable_chain(source: Any, chain: list[str]) -> Any | None:
if not result:
return None
"""
+ # chain.pop modifies passed list, this can be unexpected
+ chain = chain.copy()
chain.reverse()
try:
while chain:
+ while isinstance(source, list) and len(source) == 1:
+ source = source[0]
next_key = chain.pop()
if isinstance(source, dict):
source = source.get(next_key)
diff --git a/airflow/providers/openlineage/conf.py b/airflow/providers/openlineage/conf.py
index a9601a416b..887a931f5e 100644
--- a/airflow/providers/openlineage/conf.py
+++ b/airflow/providers/openlineage/conf.py
@@ -33,7 +33,14 @@ from __future__ import annotations
import os
from typing import Any
-from airflow.compat.functools import cache
+if os.getenv("PYTEST_VERSION"):
+
+ def decorator(func):
+ return func
+
+ cache = decorator
+else:
+ from airflow.compat.functools import cache
from airflow.configuration import conf
_CONFIG_SECTION = "openlineage"
@@ -130,3 +137,10 @@ def dag_state_change_process_pool_size() -> int:
"""[openlineage] dag_state_change_process_pool_size."""
option = conf.get(_CONFIG_SECTION, "dag_state_change_process_pool_size", fallback="")
return _safe_int_convert(str(option).strip(), default=1)
+
+
+@cache
+def execution_timeout() -> int:
+ """[openlineage] execution_timeout."""
+ option = conf.get(_CONFIG_SECTION, "execution_timeout", fallback="")
+ return _safe_int_convert(str(option).strip(), default=10)
diff --git a/airflow/providers/openlineage/plugins/listener.py b/airflow/providers/openlineage/plugins/listener.py
index e07c5507d8..4a2bff5743 100644
--- a/airflow/providers/openlineage/plugins/listener.py
+++ b/airflow/providers/openlineage/plugins/listener.py
@@ -17,12 +17,15 @@
from __future__ import annotations
import logging
+import os
from concurrent.futures import ProcessPoolExecutor
from datetime import datetime
from typing import TYPE_CHECKING
+import psutil
from openlineage.client.serde import Serde
from packaging.version import Version
+from setproctitle import getproctitle, setproctitle
from airflow import __version__ as AIRFLOW_VERSION, settings
from airflow.listeners import hookimpl
@@ -37,6 +40,7 @@ from airflow.providers.openlineage.utils.utils import (
is_selective_lineage_enabled,
print_warning,
)
+from airflow.settings import configure_orm
from airflow.stats import Stats
from airflow.utils.timeout import timeout
@@ -155,7 +159,7 @@ class OpenLineageListener:
len(Serde.to_json(redacted_event).encode("utf-8")),
)
- on_running()
+ self._fork_execute(on_running, "on_running")
@hookimpl
def on_task_instance_success(
@@ -222,7 +226,7 @@ class OpenLineageListener:
len(Serde.to_json(redacted_event).encode("utf-8")),
)
- on_success()
+ self._fork_execute(on_success, "on_success")
if _IS_AIRFLOW_2_10_OR_HIGHER:
@@ -317,10 +321,40 @@ class OpenLineageListener:
len(Serde.to_json(redacted_event).encode("utf-8")),
)
- on_failure()
+ self._fork_execute(on_failure, "on_failure")
+
+ def _fork_execute(self, callable, callable_name: str):
+ self.log.debug("Will fork to execute OpenLineage process.")
+ pid = os.fork()
+ if pid:
+ process = psutil.Process(pid)
+ try:
+ self.log.debug("Waiting for process %s", pid)
+ process.wait(conf.execution_timeout())
+ except psutil.TimeoutExpired:
+ self.log.warning(
+ "OpenLineage process %s expired. This should not affect process execution.", pid
+ )
+ process.kill()
+ except BaseException:
+ # Kill the process directly.
+ pass
+ try:
+ process.kill()
+ except Exception:
+ pass
+ self.log.warning("Process with pid %s finished - parent", pid)
+ else:
+ setproctitle(getproctitle() + " - OpenLineage - " + callable_name)
+ configure_orm(disable_connection_pool=True)
+ self.log.debug("Executing OpenLineage process - %s - pid %s", callable_name, os.getpid())
+ callable()
+ self.log.debug("Process with current pid finishes after %s", callable_name)
+ os._exit(0)
@property
def executor(self) -> ProcessPoolExecutor:
+ # Executor for dag_run listener
def initializer():
# Re-configure the ORM engine as there are issues with multiple processes
# if process calls Airflow DB.
diff --git a/airflow/providers/openlineage/provider.yaml b/airflow/providers/openlineage/provider.yaml
index de17e15c9f..f63596cdc7 100644
--- a/airflow/providers/openlineage/provider.yaml
+++ b/airflow/providers/openlineage/provider.yaml
@@ -45,8 +45,8 @@ dependencies:
- apache-airflow>=2.7.0
- apache-airflow-providers-common-sql>=1.6.0
- attrs>=22.2
- - openlineage-integration-common>=1.15.0
- - openlineage-python>=1.15.0
+ - openlineage-integration-common>=1.16.0
+ - openlineage-python>=1.16.0
integrations:
- integration-name: OpenLineage
@@ -144,3 +144,10 @@ config:
example: ~
type: integer
version_added: 1.8.0
+ execution_timeout:
+ description: |
+ Maximum amount of time (in seconds) that OpenLineage can spend executing metadata extraction.
+ default: "10"
+ example: ~
+ type: integer
+ version_added: 1.9.0
diff --git a/airflow/providers/openlineage/sqlparser.py b/airflow/providers/openlineage/sqlparser.py
index f181ff8cce..470b93d3cb 100644
--- a/airflow/providers/openlineage/sqlparser.py
+++ b/airflow/providers/openlineage/sqlparser.py
@@ -39,6 +39,7 @@ from airflow.providers.openlineage.utils.sql import (
get_table_schemas,
)
from airflow.typing_compat import TypedDict
+from airflow.utils.log.logging_mixin import LoggingMixin
if TYPE_CHECKING:
from sqlalchemy.engine import Engine
@@ -116,7 +117,7 @@ def from_table_meta(
return Dataset(namespace=namespace, name=name if not is_uppercase else name.upper())
-class SQLParser:
+class SQLParser(LoggingMixin):
"""Interface for openlineage-sql.
:param dialect: dialect specific to the database
@@ -124,11 +125,18 @@ class SQLParser:
"""
def __init__(self, dialect: str | None = None, default_schema: str | None = None) -> None:
+ super().__init__()
self.dialect = dialect
self.default_schema = default_schema
def parse(self, sql: list[str] | str) -> SqlMeta | None:
"""Parse a single or a list of SQL statements."""
+ self.log.debug(
+ "OpenLineage calling SQL parser with SQL %s dialect %s schema %s",
+ sql,
+ self.dialect,
+ self.default_schema,
+ )
return parse(sql=sql, dialect=self.dialect, default_schema=self.default_schema)
def parse_table_schemas(
@@ -151,6 +159,7 @@ class SQLParser:
"database": database or database_info.database,
"use_flat_cross_db_query": database_info.use_flat_cross_db_query,
}
+ self.log.info("PRE getting schemas for input and output tables")
return get_table_schemas(
hook,
namespace,
@@ -335,9 +344,8 @@ class SQLParser:
return split_statement(sql)
return [obj for stmt in sql for obj in cls.split_sql_string(stmt) if obj != ""]
- @classmethod
def create_information_schema_query(
- cls,
+ self,
tables: list[DbTableMeta],
normalize_name: Callable[[str], str],
is_cross_db: bool,
@@ -349,7 +357,7 @@ class SQLParser:
sqlalchemy_engine: Engine | None = None,
) -> str:
"""Create SELECT statement to query information schema table."""
- tables_hierarchy = cls._get_tables_hierarchy(
+ tables_hierarchy = self._get_tables_hierarchy(
tables,
normalize_name=normalize_name,
database=database,
diff --git a/airflow/providers/openlineage/utils/sql.py b/airflow/providers/openlineage/utils/sql.py
index f959745b93..f5d083b4e4 100644
--- a/airflow/providers/openlineage/utils/sql.py
+++ b/airflow/providers/openlineage/utils/sql.py
@@ -16,6 +16,7 @@
# under the License.
from __future__ import annotations
+import logging
from collections import defaultdict
from contextlib import closing
from enum import IntEnum
@@ -33,6 +34,9 @@ if TYPE_CHECKING:
from airflow.hooks.base import BaseHook
+log = logging.getLogger(__name__)
+
+
class ColumnIndex(IntEnum):
"""Enumerates the indices of columns in information schema view."""
@@ -90,6 +94,7 @@ def get_table_schemas(
if not in_query and not out_query:
return [], []
+ log.debug("Starting to query database for table schemas")
with closing(hook.get_conn()) as conn, closing(conn.cursor()) as cursor:
if in_query:
cursor.execute(in_query)
@@ -101,6 +106,7 @@ def get_table_schemas(
out_datasets = [x.to_dataset(namespace, database, schema) for x in parse_query_result(cursor)]
else:
out_datasets = []
+ log.debug("Got table schema query result from database.")
return in_datasets, out_datasets
diff --git a/airflow/providers/snowflake/hooks/snowflake.py b/airflow/providers/snowflake/hooks/snowflake.py
index 978bcf75e1..39e17be7b8 100644
--- a/airflow/providers/snowflake/hooks/snowflake.py
+++ b/airflow/providers/snowflake/hooks/snowflake.py
@@ -473,10 +473,10 @@ class SnowflakeHook(DbApiHook):
from airflow.providers.openlineage.extractors import OperatorLineage
from airflow.providers.openlineage.sqlparser import SQLParser
- connection = self.get_connection(getattr(self, self.conn_name_attr))
- namespace = SQLParser.create_namespace(self.get_openlineage_database_info(connection))
-
if self.query_ids:
+ self.log.info("Getting connector to get database info :sadge:")
+ connection = self.get_connection(getattr(self, self.conn_name_attr))
+ namespace = SQLParser.create_namespace(self.get_openlineage_database_info(connection))
return OperatorLineage(
run_facets={
"externalQuery": ExternalQueryRunFacet(
diff --git a/generated/provider_dependencies.json b/generated/provider_dependencies.json
index d96c77cf4c..7db7271c48 100644
--- a/generated/provider_dependencies.json
+++ b/generated/provider_dependencies.json
@@ -913,8 +913,8 @@
"apache-airflow-providers-common-sql>=1.6.0",
"apache-airflow>=2.7.0",
"attrs>=22.2",
- "openlineage-integration-common>=1.15.0",
- "openlineage-python>=1.15.0"
+ "openlineage-integration-common>=1.16.0",
+ "openlineage-python>=1.16.0"
],
"devel-deps": [],
"plugins": [
diff --git a/tests/dags/test_openlineage_execution.py b/tests/dags/test_openlineage_execution.py
new file mode 100644
index 0000000000..29fb65cf75
--- /dev/null
+++ b/tests/dags/test_openlineage_execution.py
@@ -0,0 +1,60 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import datetime
+import time
+
+from openlineage.client.generated.base import Dataset
+
+from airflow.models.dag import DAG
+from airflow.models.operator import BaseOperator
+from airflow.providers.openlineage.extractors import OperatorLineage
+
+
+class OpenLineageExecutionOperator(BaseOperator):
+ def __init__(self, *, stall_amount=0, **kwargs) -> None:
+ super().__init__(**kwargs)
+ self.stall_amount = stall_amount
+
+ def execute(self, context):
+ self.log.error("STALL AMOUNT %s", self.stall_amount)
+ time.sleep(1)
+
+ def get_openlineage_facets_on_start(self):
+ return OperatorLineage(inputs=[Dataset(namespace="test", name="on-start")])
+
+ def get_openlineage_facets_on_complete(self, task_instance):
+ self.log.error("STALL AMOUNT %s", self.stall_amount)
+ time.sleep(self.stall_amount)
+ return OperatorLineage(inputs=[Dataset(namespace="test", name="on-complete")])
+
+
+with DAG(
+ dag_id="test_openlineage_execution",
+ default_args={"owner": "airflow", "retries": 3, "start_date": datetime.datetime(2022, 1, 1)},
+ schedule="0 0 * * *",
+ dagrun_timeout=datetime.timedelta(minutes=60),
+):
+ no_stall = OpenLineageExecutionOperator(task_id="execute_no_stall")
+
+ short_stall = OpenLineageExecutionOperator(task_id="execute_short_stall", stall_amount=5)
+
+ mid_stall = OpenLineageExecutionOperator(task_id="execute_mid_stall", stall_amount=15)
+
+ long_stall = OpenLineageExecutionOperator(task_id="execute_long_stall", stall_amount=30)
diff --git a/tests/providers/openlineage/plugins/test_execution.py b/tests/providers/openlineage/plugins/test_execution.py
new file mode 100644
index 0000000000..d1b0970e19
--- /dev/null
+++ b/tests/providers/openlineage/plugins/test_execution.py
@@ -0,0 +1,187 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import json
+import logging
+import os
+import shutil
+import tempfile
+from pathlib import Path
+from unittest import mock
+
+import pytest
+
+from airflow.jobs.job import Job
+from airflow.jobs.local_task_job_runner import LocalTaskJobRunner
+from airflow.listeners.listener import get_listener_manager
+from airflow.models import DagBag, TaskInstance
+from airflow.providers.google.cloud.openlineage.utils import get_from_nullable_chain
+from airflow.providers.openlineage.plugins.listener import OpenLineageListener
+from airflow.task.task_runner.standard_task_runner import StandardTaskRunner
+from airflow.utils import timezone
+from airflow.utils.state import State
+from tests.test_utils.config import conf_vars
+
+TEST_DAG_FOLDER = os.environ["AIRFLOW__CORE__DAGS_FOLDER"]
+DEFAULT_DATE = timezone.datetime(2016, 1, 1)
+
+
+log = logging.getLogger(__name__)
+
+
+def read_file_content(file_path: str) -> str:
+ with open(file_path) as file:
+ return file.read()
+
+
+def get_sorted_events(event_dir: str) -> list[str]:
+ event_paths = [os.path.join(event_dir, event_path) for event_path in sorted(os.listdir(event_dir))]
+ return [json.loads(read_file_content(event_path)) for event_path in event_paths]
+
+
+def has_value_in_events(events, chain, value):
+ x = [get_from_nullable_chain(event, chain) for event in events]
+ log.error(x)
+ y = [z == value for z in x]
+ return any(y)
+
+
+with tempfile.TemporaryDirectory(prefix="venv") as tmp_dir:
+ listener_path = Path(tmp_dir) / "event"
+
+ @pytest.mark.usefixtures("reset_logging_config")
+ class TestOpenLineageExecution:
+ @pytest.fixture(autouse=True)
+ def clean_listener_manager(self):
+ get_listener_manager().clear()
+ yield
+ get_listener_manager().clear()
+
+ def setup_job(self, task_name, run_id):
+ dirpath = Path(tmp_dir)
+ if dirpath.exists():
+ shutil.rmtree(dirpath)
+ dirpath.mkdir(exist_ok=True, parents=True)
+ lm = get_listener_manager()
+ lm.add_listener(OpenLineageListener())
+
+ dagbag = DagBag(
+ dag_folder=TEST_DAG_FOLDER,
+ include_examples=False,
+ )
+ dag = dagbag.dags.get("test_openlineage_execution")
+ task = dag.get_task(task_name)
+
+ dag.create_dagrun(
+ run_id=run_id,
+ data_interval=(DEFAULT_DATE, DEFAULT_DATE),
+ state=State.RUNNING,
+ start_date=DEFAULT_DATE,
+ )
+ ti = TaskInstance(task=task, run_id=run_id)
+ job = Job(id="1", dag_id=ti.dag_id)
+ job_runner = LocalTaskJobRunner(job=job, task_instance=ti, ignore_ti_state=True)
+ task_runner = StandardTaskRunner(job_runner)
+ with mock.patch("airflow.task.task_runner.get_task_runner", return_value=task_runner):
+ job_runner._execute()
+
+ return task_runner.return_code(timeout=60)
+
+ @pytest.mark.db_test
+ @conf_vars({("openlineage", "transport"): f'{{"type": "file", "log_file_path": "{listener_path}"}}'})
+ def test_not_stalled_task_emits_proper_lineage(self):
+ task_name = "execute_no_stall"
+ run_id = "test1"
+ self.setup_job(task_name, run_id)
+
+ events = get_sorted_events(tmp_dir)
+ assert has_value_in_events(events, ["inputs", "name"], "on-start")
+ assert has_value_in_events(events, ["inputs", "name"], "on-complete")
+
+ @conf_vars({("openlineage", "transport"): f'{{"type": "file", "log_file_path": "{listener_path}"}}'})
+ @pytest.mark.db_test
+ def test_short_stalled_task_emits_proper_lineage(self):
+ self.setup_job("execute_short_stall", "test_short_stalled_task_emits_proper_lineage")
+ events = get_sorted_events(tmp_dir)
+ assert has_value_in_events(events, ["inputs", "name"], "on-start")
+ assert has_value_in_events(events, ["inputs", "name"], "on-complete")
+
+ @conf_vars(
+ {
+ ("openlineage", "transport"): f'{{"type": "file", "log_file_path": "{listener_path}"}}',
+ ("openlineage", "execution_timeout"): "3",
+ }
+ )
+ @pytest.mark.db_test
+ def test_short_stalled_task_extraction_with_low_execution_is_killed_by_ol_timeout(self):
+ self.setup_job(
+ "execute_short_stall",
+ "test_short_stalled_task_extraction_with_low_execution_is_killed_by_ol_timeout",
+ )
+ events = get_sorted_events(tmp_dir)
+ assert has_value_in_events(events, ["inputs", "name"], "on-start")
+ assert not has_value_in_events(events, ["inputs", "name"], "on-complete")
+
+ @conf_vars({("openlineage", "transport"): f'{{"type": "file", "log_file_path": "{listener_path}"}}'})
+ @pytest.mark.db_test
+ def test_mid_stalled_task_is_killed_by_ol_timeout(self):
+ self.setup_job("execute_mid_stall", "test_mid_stalled_task_is_killed_by_openlineage")
+ events = get_sorted_events(tmp_dir)
+ assert has_value_in_events(events, ["inputs", "name"], "on-start")
+ assert not has_value_in_events(events, ["inputs", "name"], "on-complete")
+
+ @conf_vars(
+ {
+ ("openlineage", "transport"): f'{{"type": "file", "log_file_path": "{listener_path}"}}',
+ ("openlineage", "execution_timeout"): "60",
+ ("core", "task_success_overtime"): "3",
+ }
+ )
+ @pytest.mark.db_test
+ def test_long_stalled_task_is_killed_by_listener_overtime_if_ol_timeout_long_enough(self):
+ dirpath = Path(tmp_dir)
+ if dirpath.exists():
+ shutil.rmtree(dirpath)
+ dirpath.mkdir(exist_ok=True, parents=True)
+ lm = get_listener_manager()
+ lm.add_listener(OpenLineageListener())
+
+ dagbag = DagBag(
+ dag_folder=TEST_DAG_FOLDER,
+ include_examples=False,
+ )
+ dag = dagbag.dags.get("test_openlineage_execution")
+ task = dag.get_task("execute_long_stall")
+
+ dag.create_dagrun(
+ run_id="test_long_stalled_task_is_killed_by_listener_overtime_if_ol_timeout_long_enough",
+ data_interval=(DEFAULT_DATE, DEFAULT_DATE),
+ state=State.RUNNING,
+ start_date=DEFAULT_DATE,
+ )
+ ti = TaskInstance(
+ task=task,
+ run_id="test_long_stalled_task_is_killed_by_listener_overtime_if_ol_timeout_long_enough",
+ )
+ job = Job(id="1", dag_id=ti.dag_id)
+ job_runner = LocalTaskJobRunner(job=job, task_instance=ti, ignore_ti_state=True)
+ job_runner._execute()
+
+ events = get_sorted_events(tmp_dir)
+ assert has_value_in_events(events, ["inputs", "name"], "on-start")
+ assert not has_value_in_events(events, ["inputs", "name"], "on-complete")