test: add pyleak for task and event loop block detections (#8802)

* test: add pyleak for task and event loop block detections

* test: add pyleak for task and event loop block detections

* ci: add env variables for verbose logging

* chore: dummy sleep to shwocase error

* chore: dummy sleep to showcase error

* chore: remove dummy sleep
This commit is contained in:
Deepankar Mahapatro 2025-07-01 18:37:25 +05:30 • committed by GitHub
commit 5734735e2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 46 additions and 6 deletions

View file

@ -3,6 +3,7 @@ import os
import uuid
from typing import Any
import pytest
import requests
from astrapy.admin import parse_api_endpoint
from langflow.api.v1.schemas import InputValueRequest
@ -187,3 +188,11 @@ def build_component_instance_for_tests(version: str, module: str, file_name: str
component = download_component_from_github(module, file_name, version)
cc_class = eval_custom_component_code(component._code)
return cc_class(**kwargs), component._code
def pyleak_marker(**extra_args):
default_args = {
"enable_task_creation_tracking": True, # log task creation stacks
"thread_name_filter": r"^(?!asyncio_\d+$).*", # exclude `asyncio_{num}` threads
}
return pytest.mark.no_leaks(**default_args, **extra_args)