add store retry method (#60)

This commit is contained in:
fbarbu15 2024-07-18 11:41:20 +03:00 committed by GitHub
parent cfc6aa8f72
commit ae43bd4448
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -14,6 +14,7 @@ from src.env_vars import (
from src.node.waku_node import WakuNode
from src.steps.common import StepsCommon
from src.test_data import VALID_PUBSUB_TOPICS
from tenacity import retry, stop_after_delay, wait_fixed
logger = get_custom_logger(__name__)
@ -133,6 +134,12 @@ class StepsStore(StepsCommon):
delay(message_propagation_delay)
return self.message
@retry(stop=stop_after_delay(30), wait=wait_fixed(1), reraise=True)
@allure.step
def get_messages_from_store_with_retry(self, node):
return self.get_messages_from_store(node, page_size=5)
@allure.step
def get_messages_from_store(
self,
node=None,

View File

@ -94,7 +94,7 @@ class TestReliability(StepsStore):
self.store_node1.container.start()
self.store_node1.ensure_ready()
for node in self.store_nodes:
store_response = self.get_messages_from_store(node, page_size=5)
store_response = self.get_messages_from_store_with_retry(node)
assert len(store_response.messages) == 2
def test_message_relayed_while_store_node_is_stopped_and_removed(self, node_setup):