tweaks for parallel run

This commit is contained in:
fbarbu15 2023-11-10 09:30:47 +02:00
parent 806d7941f6
commit d50b612ece
No known key found for this signature in database
GPG Key ID: D75221C8DEA22501
3 changed files with 5 additions and 3 deletions

View File

@ -49,7 +49,7 @@ jobs:
- run: pip install -r requirements.txt
- name: Run tests
run: pytest -n 5 --reruns 3 --alluredir=allure-results
run: pytest -n 4 --reruns 2 --alluredir=allure-results
- name: Get allure history
if: always()

View File

@ -1,5 +1,6 @@
import os
import logging
from time import sleep
from tenacity import retry, stop_after_delay, wait_fixed
from src.node.api_clients.rpc import RPC
from src.node.api_clients.rest import REST
@ -71,6 +72,7 @@ class WakuNode:
"Started container from image %s. RPC: %s REST: %s WebSocket: %s", self._image_name, self._rpc_port, self._rest_port, self._websocket_port
)
DS.waku_nodes.append(self)
sleep(1) # if we fire requests to soon after starting the node will sometimes fail to start correctly
try:
self.ensure_ready()
except Exception as e:
@ -84,7 +86,7 @@ class WakuNode:
self._container.stop()
logger.debug("Container stopped.")
@retry(stop=stop_after_delay(5), wait=wait_fixed(0.05), reraise=True)
@retry(stop=stop_after_delay(10), wait=wait_fixed(0.1), reraise=True)
def ensure_ready(self):
self.info()
logger.debug("RPC service is ready.")

View File

@ -27,7 +27,7 @@ class StepsRelay:
self.node2.set_subscriptions([self.test_pubsub_topic])
@pytest.fixture(scope="function", autouse=True)
@retry(stop=stop_after_delay(40), wait=wait_fixed(1), reraise=True)
@retry(stop=stop_after_delay(120), wait=wait_fixed(1), reraise=True)
def wait_for_network_to_warm_up(self):
message = {"payload": to_base64(self.test_payload), "contentTopic": self.test_content_topic, "timestamp": int(time() * 1e9)}
try: