@@ -1846,7 +1846,7 @@ def on_task_done(t: asyncio.Task):
18461846 asyncio .create_task = create_callback_task
18471847 # DEBUG
18481848 # Snapshot tasks that already exist on this loop so we can detect strays
1849- baseline_tasks = loop .run_until_complete (_snapshot_tasks ())
1849+ # baseline_tasks = loop.run_until_complete(_snapshot_tasks())
18501850
18511851 try :
18521852 for index , golden in enumerate (goldens ):
@@ -1925,36 +1925,36 @@ def on_task_done(t: asyncio.Task):
19251925 loop .run_until_complete (
19261926 asyncio .gather (* created_tasks , return_exceptions = True )
19271927 )
1928- finally :
1929- if settings .DEEPEVAL_DEBUG_ASYNC :
1930- # Find tasks that were created during this run but we didn’t track
1931- current_tasks = loop .run_until_complete (_snapshot_tasks ())
1932- leftovers = [
1933- t
1934- for t in current_tasks
1935- if t not in baseline_tasks
1936- and t not in created_tasks
1937- and not t .done ()
1938- ]
1939- if leftovers :
1940- logger .warning (
1941- "[deepeval] %d stray task(s) not tracked; cancelling…" ,
1942- len (leftovers ),
1943- )
1944- for t in leftovers :
1945- meta = task_meta .get (t , {})
1946- # Use get_name() if available, else repr()
1947- name = (
1948- t .get_name ()
1949- if hasattr (t , "get_name" )
1950- else repr (t )
1951- )
1952- logger .warning (" - STRAY %s meta=%s" , name , meta )
1953- t .cancel ()
1954- # Drain strays so they don’t leak into the next iteration
1955- loop .run_until_complete (
1956- asyncio .gather (* leftovers , return_exceptions = True )
1957- )
1928+ # finally:
1929+ # if settings.DEEPEVAL_DEBUG_ASYNC:
1930+ # # Find tasks that were created during this run but we didn’t track
1931+ # current_tasks = loop.run_until_complete(_snapshot_tasks())
1932+ # leftovers = [
1933+ # t
1934+ # for t in current_tasks
1935+ # if t not in baseline_tasks
1936+ # and t not in created_tasks
1937+ # and not t.done()
1938+ # ]
1939+ # if leftovers:
1940+ # logger.warning(
1941+ # "[deepeval] %d stray task(s) not tracked; cancelling…",
1942+ # len(leftovers),
1943+ # )
1944+ # for t in leftovers:
1945+ # meta = task_meta.get(t, {})
1946+ # # Use get_name() if available, else repr()
1947+ # name = (
1948+ # t.get_name()
1949+ # if hasattr(t, "get_name")
1950+ # else repr(t)
1951+ # )
1952+ # logger.warning(" - STRAY %s meta=%s", name, meta)
1953+ # t.cancel()
1954+ # # Drain strays so they don’t leak into the next iteration
1955+ # loop.run_until_complete(
1956+ # asyncio.gather(*leftovers, return_exceptions=True)
1957+ # )
19581958
19591959 # Evaluate traces
19601960 if trace_manager .traces_to_evaluate :
0 commit comments