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

Sync with LocusIO Repo #1

Merged
merged 50 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
357f106
More robust handling of ZMQ/RPC errors (#2120)
solowalker27 Jun 27, 2022
ae76c98
Remove timeout parameter from FastHttpUser unit tests
cyberw Jun 27, 2022
9b7a4cd
Merge pull request #2123 from locustio/remove-timeout-parameter-from-…
cyberw Jun 27, 2022
c39d8bb
Update changelog for 2.10
cyberw Jun 27, 2022
5bf50cc
Increase CONNECT_RETRY_COUNT to avoid workers giving up too soon if m…
cyberw Jun 28, 2022
e5e49b6
Merge pull request #2125 from locustio/Increase-CONNECT_RETRY_COUNT-t…
cyberw Jun 28, 2022
0be56b3
Escape user supplied data in html report (#2126) (#2127)
herrmanntom Jul 5, 2022
029bdfe
Replace the MD5 usage by SHA256
RenanGBarreto Jul 8, 2022
218e7f4
Merge pull request #2130 from RenanGBarreto/master
cyberw Jul 9, 2022
a367c3b
Fix escaping for exceptions in normal web ui (related to #2126)
Jul 11, 2022
fff90fd
Merge pull request #2131 from herrmanntom/fix-exception-escaping
cyberw Jul 11, 2022
6da38bc
implement table-sorting in report.html
Likqez Jul 13, 2022
bfbd6a2
fix: Fix typo at user/wait_time.py
DmytroLitvinov Jul 14, 2022
ea069f0
Merge pull request #2133 from DmytroLitvinov/patch-1
cyberw Jul 14, 2022
51c8344
improve report sorting
Likqez Jul 14, 2022
8709944
enabled sorting of error messages as well as stacktraces
Likqez Jul 18, 2022
a37a9b2
Merge pull request #2134 from Likqez/master
cyberw Jul 19, 2022
8b26da2
Minor edits to the documentation
sosna Jul 23, 2022
c7bacd5
Small documentation correction
andybyrne Jul 23, 2022
f823e65
Merge pull request #2138 from andybyrne/doc-update
cyberw Jul 23, 2022
a26d7a2
Minor edits to the documentation
sosna Jul 24, 2022
024e43e
Log an error for every failed attempt to connect to master
gdm85 Jul 21, 2022
cc87816
Merge pull request #2136 from gdm85/master
cyberw Jul 25, 2022
f411ef2
Minor edits to the documentation
sosna Jul 25, 2022
0a50ab1
Merge branch 'locustio:master' into master
sosna Jul 25, 2022
743055b
Minor edits to the documentation
sosna Jul 26, 2022
6a0921b
Minor edits to the documentation
sosna Jul 26, 2022
62b486b
Merge pull request #2140 from sosna/master
cyberw Jul 26, 2022
d7ca350
Stop calling attributes 'properties' in some places.
cyberw Jul 27, 2022
3ed62e0
Give a better error message when someone accidentally sets User.task …
cyberw Jul 27, 2022
fedc61d
Fix detection of accidental TaskSet.task attribute
cyberw Jul 27, 2022
a5b31f6
fix spelling in comment
cyberw Jul 28, 2022
c2c9533
Merge pull request #2142 from locustio/better-error-message-when-User…
cyberw Jul 28, 2022
ee6f598
style: add a report favicon
Pactortester Jul 31, 2022
425141a
Merge pull request #2145 from Pactortester/patch-1
cyberw Jul 31, 2022
7c31c36
Removed cache_timeout kwarg from request_stats_full_history_csv for f…
mikenester Aug 2, 2022
fed1ffb
temporary change to see logs for py38
mikenester Aug 2, 2022
06dba4a
restored resource warning masking
mikenester Aug 2, 2022
90ee9a6
enabled tracemalloc temporarily
mikenester Aug 2, 2022
5fcdc34
removed tracemalloc
mikenester Aug 3, 2022
61f8b83
Merge pull request #2148 from mikenester/request-stats-fix-for-flask-…
cyberw Aug 3, 2022
8c50d64
Ensure no caching of stats history csv (replaces cache_timeout=None w…
cyberw Aug 3, 2022
a3d7873
Update changelog for 2.10.2 (automatic changelog generation is broken…
cyberw Aug 3, 2022
dfa3074
test: Implement failing test for issue #2135
mboutet Aug 7, 2022
540415e
fix: Set users_dispatcher to None when test is stopped
mboutet Aug 7, 2022
9165209
chore: Remove misleading docstring in test
mboutet Aug 7, 2022
0d32490
chore: Do not use intermediate variable for one-use
mboutet Aug 7, 2022
2698c73
perf(test): Decrease test runtime
mboutet Aug 7, 2022
6746d66
Merge pull request #2152 from mboutet/issue-2135
cyberw Aug 7, 2022
5f7b4fb
Merge pull request #2153 from mboutet/mboutet-patch-1
cyberw Aug 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Changelog
Note that PRs for the latest version are sometimes missing here, check [github](https://github.com/locustio/locust/releases) for the latest info.
# Automatic change log generation is broken at the moment. See [github](https://github.com/locustio/locust/releases) instead.

------------------------------------------------------------------------------------------------------------------------------

## [2.10.2](https://github.com/locustio/locust/tree/2.10.2)

[Full Changelog](https://github.com/locustio/locust/compare/2.10.1...2.10.2)

## [2.10.1](https://github.com/locustio/locust/tree/2.10.1)

[Full Changelog](https://github.com/locustio/locust/compare/2.10.0...2.10.1)

## [2.10.0](https://github.com/locustio/locust/tree/2.10.0) (2022-06-27)

[Full Changelog](https://github.com/locustio/locust/compare/2.9.0...2.10.0)

**Closed issues:**

- Add ACK for worker connection [\#2044](https://github.com/locustio/locust/issues/2044)

**Merged pull requests:**

- Remove timeout parameter from FastHttpUser unit tests [\#2123](https://github.com/locustio/locust/pull/2123) ([cyberw](https://github.com/cyberw))
- Convert url for getting tasks to relative [\#2121](https://github.com/locustio/locust/pull/2121) ([5imun](https://github.com/5imun))
- More robust handling of ZMQ/RPC errors [\#2120](https://github.com/locustio/locust/pull/2120) ([solowalker27](https://github.com/solowalker27))
- Update the link for reporting data to a database [\#2119](https://github.com/locustio/locust/pull/2119) ([AlexMooney](https://github.com/AlexMooney))
- fix: stopping state when running more than one worker node. [\#2116](https://github.com/locustio/locust/pull/2116) ([renato-farias](https://github.com/renato-farias))
- add support for custom SSLContext when using FastHttpUser [\#2113](https://github.com/locustio/locust/pull/2113) ([renato-farias](https://github.com/renato-farias))
- chore: Set permissions for GitHub actions [\#2107](https://github.com/locustio/locust/pull/2107) ([naveensrinivasan](https://github.com/naveensrinivasan))
- additional typing improvements [\#2106](https://github.com/locustio/locust/pull/2106) ([mgor](https://github.com/mgor))
- Stop client\_listener from raising a KeyError when receiving a client\_stopped message from unknown worker [\#2102](https://github.com/locustio/locust/pull/2102) ([BirdLearn](https://github.com/BirdLearn))
- Fix multiple resetting connection after RPCError [\#2096](https://github.com/locustio/locust/pull/2096) ([Nosibb](https://github.com/Nosibb))
- Add ack for worker connection [\#2077](https://github.com/locustio/locust/pull/2077) ([Nosibb](https://github.com/Nosibb))

## [2.9.0](https://github.com/locustio/locust/tree/2.9.0) (2022-05-19)

Expand Down
15 changes: 15 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ Changelog Highlights

For full details of the Locust changelog, please see https://github.com/locustio/locust/blob/master/CHANGELOG.md

2.10.2
======
* Fix for Flask 2.2.0 breaking changes https://github.com/locustio/locust/pull/2148

2.10.1
======
* Increase CONNECT_RETRY_COUNT to avoid workers giving up too soon if master is not up yet by https://github.com/locustio/locust/pull/2125

2.10.0
======
* Add ack for worker connection https://github.com/locustio/locust/pull/2077 (note that 2.10 workers will not work with a 2.9 master)
* add support for custom SSLContext when using FastHttpUser https://github.com/locustio/locust/pull/2113
* More robust handling of ZMQ/RPC errors https://github.com/locustio/locust/pull/2120 / https://github.com/locustio/locust/pull/2096
* Full Changelog https://github.com/locustio/locust/compare/2.9.0...2.10.0

2.9.0
=====

Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Customization of statistics settings

Default configuration for Locust statistics is set in constants of stats.py file.
It can be tuned to specific requirements by overriding these values.
To do this, import locust.stats module and override required settings
To do this, import locust.stats module and override required settings:

.. code-block:: python

Expand Down
4 changes: 2 additions & 2 deletions docs/developing-locust.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You want to contribute to Locust? Great! Here is a list of `open bugs/feature re
Install Locust for development
==============================

Fork Locust on `Github <https://github.com/locustio/locust/>`_ and then run
Fork Locust on `GitHub <https://github.com/locustio/locust/>`_ and then run

.. code-block:: console

Expand Down Expand Up @@ -53,7 +53,7 @@ Then you can build the documentation locally using:

make build_docs

Then the documentation should be build and available at ``docs/_build/index.html``
Then the documentation should be build and available at ``docs/_build/index.html``.



Expand Down
2 changes: 1 addition & 1 deletion docs/extending-locust.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For example, here's how to set up an event listener that will trigger after a re

.. note::

In the above example the wildcard keyword argument (\**kwargs) will be empty, because we're handling all arguments, but it is prevents the code from breaking if new arguments are added in some future version of Locust.
In the above example the wildcard keyword argument (\**kwargs) will be empty, because we're handling all arguments, but it prevents the code from breaking if new arguments are added in some future version of Locust.

Also, it is entirely possible to implement a client that does not supply all parameters for this event.
For example, non-HTTP protocols might not even have the a concept of `url` or `response` object.
Expand Down
2 changes: 1 addition & 1 deletion docs/further-reading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ You'll also find a lot of answers on `stackoverflow <https://stackoverflow.com/q

In other words, just google whatever problem or error message you're getting and you are likely to find good answers out there.

If you think Locust is missing some obvious feature (like stopping after a certain number of iterations/requests, setting goals/thresholds for when to fail a test run, support for additional User types like Kafka, Selenium/WebDriver etc), chances are it is implemented in `locust-plugins <https://github.com/SvenskaSpel/locust-plugins/>`_
If you think Locust is missing some obvious feature (like stopping after a certain number of iterations/requests, setting goals/thresholds for when to fail a test run, support for additional User types like Kafka, Selenium/WebDriver etc), chances are it is implemented in `locust-plugins <https://github.com/SvenskaSpel/locust-plugins/>`_.
2 changes: 1 addition & 1 deletion docs/increase-performance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Just subclass FastHttpUser instead of HttpUser::

.. note::

FastHttpUser/geventhttpclient is very similar to for HttpUser/python-requests, but sometimes there are subtle differences. This is particularly true if you work with the client library's internals, e.g. when manually managing cookies.
FastHttpUser/geventhttpclient is very similar to HttpUser/python-requests, but sometimes there are subtle differences. This is particularly true if you work with the client library's internals, e.g. when manually managing cookies.

API
===
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Installation
============

`Install Python <https://docs.python-guide.org/starting/installation/>`_ 3.7 or later, if you dont already have it.
`Install Python <https://docs.python-guide.org/starting/installation/>`_ 3.7 or later, if you don't already have it.

Install Locust:

Expand Down
10 changes: 5 additions & 5 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Getting started
===============

A Locust test is essentially a Python program. This makes it very flexible and particularly good at implementing complex user flows. But it can do simple tests as well, so lets start with that:
A Locust test is essentially a Python program. This makes it very flexible and particularly good at implementing complex user flows. But it can do simple tests as well, so let's start with that:

.. code-block:: python

Expand Down Expand Up @@ -55,17 +55,17 @@ Number of users:

.. note::

Interpreting performance test results is quite complex (and mostly out of scope for this manual), but if your graphs start looking like this, the most likely reason is that your target service/system cannot handle the load you are hitting it with (it is overloaded or "saturated")
Interpreting performance test results is quite complex (and mostly out of scope for this manual), but if your graphs start looking like this, the most likely reason is that your target service/system cannot handle the load you are hitting it with (it is overloaded or "saturated").

The clearest sign of this is that when we get to around 9 users, response times start increasing so fast that the requests per second-curve flattens out, even though new users are still being added.

If you're having trouble generating enough load to saturate your system, or need some pointers on how to start digging into a server side problem have a look at the `Locust FAQ <https://github.com/locustio/locust/wiki/FAQ#increase-my-request-raterps>`_
If you're having trouble generating enough load to saturate your system, or need some pointers on how to start digging into a server side problem have a look at the `Locust FAQ <https://github.com/locustio/locust/wiki/FAQ#increase-my-request-raterps>`_.


Direct command line usage / headless
====================================

Using the Locust web UI is entirely optional. You can supply the load parameters on command line and get reports on the results in text form:
Using the Locust web UI is entirely optional. You can supply the load parameters on the command line and get reports on the results in text form:

.. code-block:: console
:substitutions:
Expand Down Expand Up @@ -100,4 +100,4 @@ To see all available options type: ``locust --help`` or check :ref:`configuratio

|

Now, lets have a more in-depth look at locustfiles and what they can do: :ref:`writing-a-locustfile`
Now, let's have a more in-depth look at locustfiles and what they can do: :ref:`writing-a-locustfile`.
8 changes: 4 additions & 4 deletions docs/running-distributed.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Optionally used together with ``--worker`` to set the port number of the master
``--master-bind-host=X.X.X.X``
------------------------------

Optionally used together with ``--master``. Determines what network interface that the master node
Optionally used together with ``--master``. Determines which network interface the master node
will bind to. Defaults to * (all available interfaces).

``--master-bind-port=5557``
Expand Down Expand Up @@ -118,7 +118,7 @@ order to coordinate data. This can be easily accomplished with custom messages u
environment.runner.send_message('test_users', users)

Note that when running locally (i.e. non-distributed), this functionality will be preserved;
the messages will simply be handled by the same runner that sends them.
the messages will simply be handled by the runner that sends them.

A more complete example can be found in the `examples directory <https://github.com/locustio/locust/tree/master/examples>`_ of the Locust
source code.
Expand All @@ -139,5 +139,5 @@ See :ref:`running-distributed-without-web-ui`
Increase Locust's performance
=============================

If you're planning to run large-scale load tests you might be interested to use the alternative
HTTP client that's shipped with Locust. You can read more about it here: :ref:`increase-performance`
If you're planning to run large-scale load tests, you might be interested to use the alternative
HTTP client that's shipped with Locust. You can read more about it here: :ref:`increase-performance`.
6 changes: 3 additions & 3 deletions docs/running-in-debugger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Running Locust in a debugger is extremely useful when developing your tests. Amo

But debuggers sometimes have issues with complex gevent-applications like Locust, and there is a lot going on in the framework itself that you probably aren't interested in. To simplify this, Locust provides a method called :py:func:`run_single_user <locust.debug.run_single_user>`:

Note that this is fairly new feature, and the api is subject to change.
Note that this is a fairly new feature, and the api is subject to change.

.. literalinclude:: ../examples/debugging.py
:language: python
Expand All @@ -28,12 +28,12 @@ Make sure you have enabled gevent in your debugger settings. In VS Code's ``laun
.. literalinclude:: ../.vscode/launch.json
:language: json

There is a similar setting in `PyCharm <https://www.jetbrains.com/help/pycharm/debugger-python.html>`_
There is a similar setting in `PyCharm <https://www.jetbrains.com/help/pycharm/debugger-python.html>`_.

.. note::

| VS Code/pydev may give you warnings about:
| ``sys.settrace() should not be used when the debugger is being used``
| It can safely be ignored (and if you know how to get rid of it, please let us know)

You can execute run_single_user multiple times, as shown in `debugging_advanced.py <https://github.com/locustio/locust/tree/master/examples/debugging_advanced.py>`_
You can execute run_single_user multiple times, as shown in `debugging_advanced.py <https://github.com/locustio/locust/tree/master/examples/debugging_advanced.py>`_.
4 changes: 2 additions & 2 deletions docs/running-in-docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ official Locust docker image as a base image::
Running a distributed load test on Kubernetes
=============================================

The easiest way to run Locust on Kubernetes is to use a `Helm chart <https://helm.sh/>`_
The easiest way to run Locust on Kubernetes is to use a `Helm chart <https://helm.sh/>`_.

There is a good helm chart here: `github.com/deliveryhero/helm-charts <https://github.com/deliveryhero/helm-charts/tree/master/stable/locust>`_
There is a good helm chart here: `github.com/deliveryhero/helm-charts <https://github.com/deliveryhero/helm-charts/tree/master/stable/locust>`_.

Note: this Helm chart is a separate project, and not supported by Locust maintainers.
2 changes: 1 addition & 1 deletion docs/running-without-web-ui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ Below is an example that'll set the exit code to non zero if any of the followin
else:
environment.process_exit_code = 0

(this code could go into the locustfile.py or in any other file that is imported in the locustfile)
Note that this code could go into the locustfile.py or in any other file that is imported in the locustfile.
2 changes: 1 addition & 1 deletion docs/tasksets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ For example, the following code will request URLs /1-/4 in order, and then repea
self.client.get("/1")
self.client.get("/2")

# you can still use the tasks property to specify a list of tasks
# you can still use the tasks attribute to specify a list of tasks
tasks = [function_task]

@task
Expand Down
10 changes: 5 additions & 5 deletions docs/testing-other-systems.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ Locust only comes with built-in support for HTTP/HTTPS but it can be extended to

It is important that the protocol libraries you use can be `monkey-patched <http://www.gevent.org/intro.html#monkey-patching>`_ by gevent.

Almost any libraries that are pure Python (using the Python ``socket`` module or some other standard library function like ``subprocess``) should work fine out of the box - but if they do their I/O calls in C gevent will be unable to patch it. This will block the whole Locust/Python process (in practice limiting you to running a single User per worker process)
Almost any libraries that are pure Python (using the Python ``socket`` module or some other standard library function like ``subprocess``) should work fine out of the box - but if they do their I/O calls in C, gevent will be unable to patch it. This will block the whole Locust/Python process (in practice limiting you to running a single User per worker process).

Some C libraries allow for other workarounds. For example, if you want to use psycopg2 to performance test PostgreSQL, you can use `psycogreen <https://github.com/psycopg/psycogreen/>`_. If you are willing to get your hands dirty, you may also be able to do patch a library yourself, but that is beyond the scope of this documentation.
Some C libraries allow for other workarounds. For example, if you want to use psycopg2 to performance test PostgreSQL, you can use `psycogreen <https://github.com/psycopg/psycogreen/>`_. If you are willing to get your hands dirty, you may also be able to patch a library yourself, but that is beyond the scope of this documentation.

Example: writing an XML-RPC User/client
=======================================

Lets assume we had an XML-RPC server that we wanted to load test
Lets assume we had an XML-RPC server that we wanted to load test.

.. literalinclude:: ../examples/custom_xmlrpc_client/server.py

We can build a generic XML-RPC client, by wrapping :py:class:`xmlrpc.client.ServerProxy`
We can build a generic XML-RPC client, by wrapping :py:class:`xmlrpc.client.ServerProxy`.

.. literalinclude:: ../examples/custom_xmlrpc_client/xmlrpc_locustfile.py

Expand All @@ -47,4 +47,4 @@ gRPC client, base User and example usage:
.. literalinclude:: ../examples/grpc/locustfile.py


For more examples of user types, see `locust-plugins <https://github.com/SvenskaSpel/locust-plugins#users>`_ (it has users for WebSocket/SocketIO, Kafka, Selenium/WebDriver and more)
For more examples of user types, see `locust-plugins <https://github.com/SvenskaSpel/locust-plugins#users>`_ (it has users for WebSocket/SocketIO, Kafka, Selenium/WebDriver and more).
4 changes: 2 additions & 2 deletions docs/testing-requests-based SDK's.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
Testing Requests based SDKs
=============================

If a prebuilt SDK is available for your target system. Locust has a supported pattern for integrating
If a prebuilt SDK is available for your target system, Locust has a supported pattern for integrating
its usage into your load testing efforts.

The only perquisite to achieve this; is that the SDK needs to have an accessible ``request.Sessions``
The only prerequisite to achieve this is that the SDK needs to have an accessible ``request.Sessions``
class.

The following example shows the locust client overwriting the internal ``_session`` object of ``Archivist`` SDK
Expand Down
Loading