ironic-python-agent/ironic_python_agent/tests
Dmitry Tantsur 2ab8364649
Add a jitter to heartbeat retries
Currently, if heartbeat fails, we reschedule it after 5 seconds.
This is fine for the first retry, but it can cause a thundering herd
problem when a lot of nodes fail to heartbeat at once.

This change adds jitter to the minimum wait of 5 seconds. The jitter is
not applied for forced heartbeats: they still have a minimum wait of
exactly 5 seconds from the last heartbeat.

The code is re-ordered to move the interval calculation to one place.
Bonus: correctly logging the next interval.

The unit tests have been rewritten to test the heartbeat process step by
step and not rely on the exact sequence of the calls.

Closes-Bug: #2038438
Change-Id: I4c4207b15fb3d48b55e340b7b3b54af833f92cb5
2023-12-13 17:34:24 +01:00
..
functional Fix and run the correct functional tests job 2020-09-04 17:10:41 +02:00
unit Add a jitter to heartbeat retries 2023-12-13 17:34:24 +01:00
__init__.py Adding oslotest to improve debugging 2014-04-03 14:02:53 -07:00