Skip to content

Commit

Permalink
Merge pull request #217 from armosec/fix-sleep
Browse files Browse the repository at this point in the history
add sleep before test message check
  • Loading branch information
refaelm92 authored Jan 3, 2024
2 parents a4ff206 + 44d7998 commit 15d4269
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests_scripts/users_notifications/alert_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

NOTIFICATIONS_SVC_DELAY = 6 * 60

TEST_MESSAGE_DELAY = 10

TEST_NAMESPACE = "alerts"


Expand Down Expand Up @@ -202,6 +204,8 @@ def assert_all_messages_sent(self, begin_time, cluster):
TestUtil.sleep(30, "waiting additional 30 seconds for messages to arrive")

def assert_test_message_sent(self, before_test):
TestUtil.sleep(TEST_MESSAGE_DELAY, "waiting for test message")
messages = self.test_obj["getMessagesFunc"](before_test)
assert len(messages) == 1, "expected to be only one message"
assert len(messages) > 0, "no messages found"
assert len(messages) < 2, "expected to be only one message"
assert "Test Alert" in str(messages[0]), "expected message to be a Test Alert"

0 comments on commit 15d4269

Please sign in to comment.