We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6160c8 commit 4300c10Copy full SHA for 4300c10
distributed/core.py
@@ -3,6 +3,7 @@
3
import asyncio
4
import inspect
5
import logging
6
+import os
7
import sys
8
import threading
9
import traceback
@@ -356,6 +357,15 @@ def __init__(
356
357
358
if not hasattr(self.io_loop, "profile"):
359
if dask.config.get("distributed.worker.profile.enabled"):
360
+ current_test = os.environ.get("PYTEST_CURRENT_TEST")
361
+ if current_test and "_profile" not in 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
+
369
ref = weakref.ref(self.io_loop)
370
371
def stop() -> bool:
0 commit comments