Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up tests #1831

Merged
merged 1 commit into from
Jul 29, 2021
Merged

Speed up tests #1831

merged 1 commit into from
Jul 29, 2021

Conversation

mboutet
Copy link
Contributor

@mboutet mboutet commented Jul 29, 2021

Before:

================================================================================================================================================== slowest durations ===================================================================================================================================================
76.82s call     locust/test/test_runners.py::TestMasterWorkerRunners::test_distributed_shape_with_stop_timeout
30.28s call     locust/test/test_runners.py::TestMasterWorkerRunners::test_distributed_shape_statuses_transition
26.41s call     locust/test/test_dispatch.py::TestRampUpThenDownThenUp::test_ramp_up_then_down_then_up
20.31s call     locust/test/test_runners.py::TestMasterWorkerRunners::test_swarm_endpoint_is_non_blocking
19.25s call     locust/test/test_runners.py::TestLocustRunner::test_swarm_endpoint_is_non_blocking
10.18s call     locust/test/test_runners.py::TestMasterWorkerRunners::test_can_call_stop_endpoint_if_currently_swarming
10.16s call     locust/test/test_runners.py::TestLocustRunner::test_can_call_stop_endpoint_if_currently_swarming
9.09s call     locust/test/test_zmqrpc.py::ZMQRPC_tests::test_rpc_error
7.16s call     locust/test/test_runners.py::TestMasterWorkerRunners::test_distributed_shape
6.30s call     locust/test/test_runners.py::TestLocustRunner::test_reset_stats
6.05s call     locust/test/test_runners.py::TestMasterRunner::test_master_marks_downed_workers_as_missing
6.02s call     locust/test/test_main.py::LocustProcessIntegrationTest::test_input
5.56s call     locust/test/test_runners.py::TestMasterRunner::test_custom_shape_scale_down
5.56s call     locust/test/test_runners.py::TestMasterRunner::test_custom_shape_scale_up
5.16s call     locust/test/test_runners.py::TestMasterWorkerRunners::test_distributed_shape_stop_and_restart
4.26s call     locust/test/test_runners.py::TestMasterRunner::test_rebalance_locust_users_on_worker_connect
3.10s call     locust/test/test_stats.py::TestCsvStats::test_user_count_in_csv_history_stats
3.07s call     locust/test/test_runners.py::TestWorkerRunner::test_worker_messages_sent_to_master
2.56s call     locust/test/test_runners.py::TestLocustRunner::test_cpu_warning
2.36s call     locust/test/test_runners.py::TestMasterRunner::test_attributes_populated_when_calling_start
2.06s call     locust/test/test_runners.py::TestStopTimeout::test_stop_timeout_with_ramp_down
1.89s call     locust/test/test_dispatch.py::TestLargeScale::test_ramp_down_from_100_000_to_0_users_with_50_user_classes_and_1000_workers_and_5000_spawn_rate
1.83s call     locust/test/test_dispatch.py::TestLargeScale::test_ramp_up_from_0_to_100_000_users_with_50_user_classes_and_1000_workers_and_5000_spawn_rate
1.76s call     locust/test/test_runners.py::TestMasterWorkerRunners::test_distributed_integration_run
1.62s call     locust/test/test_dispatch.py::TestRampUpUsersFromZero::test_ramp_up_users_to_4_workers_with_spawn_rate_of_1
1.62s call     locust/test/test_dispatch.py::TestRampDownUsersToZero::test_ramp_down_users_to_3_workers_with_spawn_rate_of_0_5
1.62s call     locust/test/test_dispatch.py::TestRampDownUsersToZero::test_ramp_down_users_to_3_workers_with_spawn_rate_of_1
1.62s call     locust/test/test_dispatch.py::TestRampUpUsersFromZero::test_ramp_up_users_to_3_workers_with_spawn_rate_of_1
1.61s call     locust/test/test_dispatch.py::TestRampUpUsersFromZero::test_ramp_up_users_to_3_workers_with_spawn_rate_of_0_5
1.61s call     locust/test/test_dispatch.py::TestRampDownUsersToZero::test_ramp_down_users_to_4_workers_with_spawn_rate_of_1
1.47s call     locust/test/test_runners.py::TestMasterWorkerRunners::test_test_stop_event
1.26s call     locust/test/test_dispatch.py::TestLargeScale::test_distribute_users
1.16s call     locust/test/test_runners.py::TestMasterRunner::test_last_worker_missing_stops_test
1.07s call     locust/test/test_runners.py::TestWorkerRunner::test_spawn_message_with_older_timestamp_is_rejected
1.06s call     locust/test/test_runners.py::TestWorkerRunner::test_change_user_count_during_spawning
1.06s call     locust/test/test_runners.py::TestLocustRunner::test_user_classes_count

Now:

================================================================================================================================================= slowest 30 durations =================================================================================================================================================
46.48s call     locust/test/test_runners.py::TestMasterWorkerRunners::test_distributed_shape_with_stop_timeout
17.24s call     locust/test/test_dispatch.py::TestRampUpThenDownThenUp::test_ramp_up_then_down_then_up
16.08s call     locust/test/test_runners.py::TestMasterWorkerRunners::test_distributed_shape_statuses_transition
10.17s call     locust/test/test_runners.py::TestMasterWorkerRunners::test_can_call_stop_endpoint_if_currently_swarming
10.16s call     locust/test/test_runners.py::TestLocustRunner::test_can_call_stop_endpoint_if_currently_swarming
9.07s call     locust/test/test_zmqrpc.py::ZMQRPC_tests::test_rpc_error
7.41s call     locust/test/test_main.py::LocustProcessIntegrationTest::test_input
7.17s call     locust/test/test_runners.py::TestMasterWorkerRunners::test_distributed_shape
6.30s call     locust/test/test_runners.py::TestLocustRunner::test_reset_stats
6.05s call     locust/test/test_runners.py::TestMasterRunner::test_master_marks_downed_workers_as_missing
5.56s call     locust/test/test_runners.py::TestMasterRunner::test_custom_shape_scale_up
5.55s call     locust/test/test_runners.py::TestMasterRunner::test_custom_shape_scale_down
5.44s call     locust/test/test_main.py::LocustProcessIntegrationTest::test_html_report_option
5.17s call     locust/test/test_runners.py::TestMasterWorkerRunners::test_distributed_shape_stop_and_restart
4.27s call     locust/test/test_runners.py::TestMasterRunner::test_rebalance_locust_users_on_worker_connect
4.22s call     locust/test/test_runners.py::TestMasterWorkerRunners::test_swarm_endpoint_is_non_blocking
3.24s call     locust/test/test_runners.py::TestLocustRunner::test_swarm_endpoint_is_non_blocking
3.11s call     locust/test/test_stats.py::TestCsvStats::test_user_count_in_csv_history_stats
3.07s call     locust/test/test_runners.py::TestWorkerRunner::test_worker_messages_sent_to_master
2.57s call     locust/test/test_runners.py::TestLocustRunner::test_cpu_warning
2.38s call     locust/test/test_runners.py::TestMasterRunner::test_attributes_populated_when_calling_start
2.07s call     locust/test/test_main.py::LocustProcessIntegrationTest::test_web_options
2.05s call     locust/test/test_runners.py::TestStopTimeout::test_stop_timeout_with_ramp_down
1.87s call     locust/test/test_dispatch.py::TestLargeScale::test_ramp_up_from_0_to_100_000_users_with_50_user_classes_and_1000_workers_and_5000_spawn_rate
1.84s call     locust/test/test_dispatch.py::TestLargeScale::test_ramp_down_from_100_000_to_0_users_with_50_user_classes_and_1000_workers_and_5000_spawn_rate
1.78s call     locust/test/test_runners.py::TestMasterWorkerRunners::test_distributed_integration_run
1.62s call     locust/test/test_dispatch.py::TestRampDownUsersToZero::test_ramp_down_users_to_3_workers_with_spawn_rate_of_1
1.62s call     locust/test/test_dispatch.py::TestRampUpUsersFromZero::test_ramp_up_users_to_3_workers_with_spawn_rate_of_1
1.62s call     locust/test/test_dispatch.py::TestRampUpUsersFromZero::test_ramp_up_users_to_3_workers_with_spawn_rate_of_0_5
1.62s call     locust/test/test_dispatch.py::TestRampUpUsersFromZero::test_ramp_up_users_to_4_workers_with_spawn_rate_of_1
====================================================================================================================================== 395 passed, 1 skipped in 259.45s (0:04:19) ======================================================================================================================================

@cyberw
Copy link
Collaborator

cyberw commented Jul 29, 2021

Nice, almost a halving... let me try re-running it a couple times, just to see that it is stable on GH too...

@cyberw cyberw merged commit bc70a26 into locustio:master Jul 29, 2021
@cyberw
Copy link
Collaborator

cyberw commented Jul 29, 2021

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants