1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-07 04:27:15 +00:00

[PR #11273/b2f16f18 backport][stable-10] test(integration): monit: backport of PR 11255 (#11274)

test(integration): monit: backport of PR 11255 (#11273)

* test(integration): monit: backport of PR 11255

* add changelog frag

(cherry picked from commit b2f16f184a)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2025-12-12 07:42:19 +01:00 committed by GitHub
parent 06c24f1f6a
commit f5b3f7da24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 0 deletions

View file

@ -259,6 +259,9 @@ class Monit(object):
def change_state(self, state, expected_status, invert_expected=None):
current_status = self.get_status()
self.run_command(STATE_COMMAND_MAP[state])
# Give monit daemon a moment to process the command before checking status
# to avoid race condition where HTTP interface may be temporarily unresponsive
time.sleep(0.5)
status = self.wait_for_status_change(current_status)
status = self.wait_for_monit_to_stop_pending(status)
status_match = status.value == expected_status.value