mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
test(integration): monit: backport of PR 11255 (#11273)
* test(integration): monit: backport of PR 11255 * add changelog frag
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user