add store retry method (#60)
This commit is contained in:
parent
cfc6aa8f72
commit
ae43bd4448
|
@ -14,6 +14,7 @@ from src.env_vars import (
|
||||||
from src.node.waku_node import WakuNode
|
from src.node.waku_node import WakuNode
|
||||||
from src.steps.common import StepsCommon
|
from src.steps.common import StepsCommon
|
||||||
from src.test_data import VALID_PUBSUB_TOPICS
|
from src.test_data import VALID_PUBSUB_TOPICS
|
||||||
|
from tenacity import retry, stop_after_delay, wait_fixed
|
||||||
|
|
||||||
logger = get_custom_logger(__name__)
|
logger = get_custom_logger(__name__)
|
||||||
|
|
||||||
|
@ -133,6 +134,12 @@ class StepsStore(StepsCommon):
|
||||||
delay(message_propagation_delay)
|
delay(message_propagation_delay)
|
||||||
return self.message
|
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(
|
def get_messages_from_store(
|
||||||
self,
|
self,
|
||||||
node=None,
|
node=None,
|
||||||
|
|
|
@ -94,7 +94,7 @@ class TestReliability(StepsStore):
|
||||||
self.store_node1.container.start()
|
self.store_node1.container.start()
|
||||||
self.store_node1.ensure_ready()
|
self.store_node1.ensure_ready()
|
||||||
for node in self.store_nodes:
|
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
|
assert len(store_response.messages) == 2
|
||||||
|
|
||||||
def test_message_relayed_while_store_node_is_stopped_and_removed(self, node_setup):
|
def test_message_relayed_while_store_node_is_stopped_and_removed(self, node_setup):
|
||||||
|
|
Loading…
Reference in New Issue