diff --git a/locust/user/task.py b/locust/user/task.py index 7019cb2c96..507d85592f 100644 --- a/locust/user/task.py +++ b/locust/user/task.py @@ -31,6 +31,10 @@ def create_thread(self): """ def decorator_func(func): + if func.__name__ in ["on_stop", "on_start"]: + logging.warning( + "You have tagged your on_stop/start function with @task. This will make the method get called both as a task AND on stop/start." + ) # this is usually not what the user intended func.locust_task_weight = weight return func