File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -475,6 +475,11 @@ def test_version_option():
475475 assert result .exit_code == 0
476476
477477
478+ @pytest .mark .filterwarnings (
479+ "ignore"
480+ ":The profiler was enabled in .* running the profiler in tests is not recommended"
481+ ":RuntimeWarning"
482+ )
478483@pytest .mark .slow
479484def test_idle_timeout ():
480485 start = time ()
@@ -483,8 +488,8 @@ def test_idle_timeout():
483488 distributed .cli .dask_scheduler .main , ["--idle-timeout" , "1s" ]
484489 )
485490 stop = time ()
486- assert 1 < stop - start < 10
487491 assert result .exit_code == 0
492+ assert 1 < stop - start < 10
488493
489494
490495@pytest .mark .slow
Original file line number Diff line number Diff line change 33import asyncio
44import inspect
55import logging
6+ import os
67import sys
78import threading
89import traceback
@@ -356,6 +357,15 @@ def __init__(
356357
357358 if not hasattr (self .io_loop , "profile" ):
358359 if dask .config .get ("distributed.worker.profile.enabled" ):
360+ current_test = os .environ .get ("PYTEST_CURRENT_TEST" )
361+ if current_test :
362+ warnings .warn (
363+ f"The profiler was enabled in { current_test } ."
364+ " running the profiler in tests is not recommended." ,
365+ RuntimeWarning ,
366+ stacklevel = 2 ,
367+ )
368+
359369 ref = weakref .ref (self .io_loop )
360370
361371 def stop () -> bool :
You can’t perform that action at this time.
0 commit comments