From 046eeb26c37c97a0528fe1526f1c52d2ebf73a23 Mon Sep 17 00:00:00 2001 From: Lars Holmberg Date: Wed, 29 Jan 2020 09:08:03 +0100 Subject: [PATCH] Clarify when setup/teardown and on_start/on_stop methods are run --- docs/writing-a-locustfile.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/writing-a-locustfile.rst b/docs/writing-a-locustfile.rst index 45f7e707f8..b06836c9ca 100644 --- a/docs/writing-a-locustfile.rst +++ b/docs/writing-a-locustfile.rst @@ -333,13 +333,13 @@ Order of events Since many setup and cleanup operations are dependent on each other, here is the order which they are run: -1. Locust setup -2. TaskSet setup -3. TaskSet on_start +1. Locust setup (once) +2. TaskSet setup (once) +3. TaskSet on_start (once per locust) 4. TaskSet tasks... -5. TaskSet on_stop -6. TaskSet teardown -7. Locust teardown +5. TaskSet on_stop (once per locust) +6. TaskSet teardown (once) +7. Locust teardown (once) In general, the setup and teardown methods should be complementary.