fixes for latest failures and bugfixes (#17)
* fixes for latest failures and bugfixes * other fixes
This commit is contained in:
parent
8cb44f1201
commit
98c76dc214
|
@ -44,5 +44,3 @@ class WakuMessage:
|
||||||
assert str(message.meta) == str(sent_message["meta"]), assert_fail_message("meta")
|
assert str(message.meta) == str(sent_message["meta"]), assert_fail_message("meta")
|
||||||
if "ephemeral" in sent_message:
|
if "ephemeral" in sent_message:
|
||||||
assert str(message.ephemeral) == str(sent_message["ephemeral"]), assert_fail_message("ephemeral")
|
assert str(message.ephemeral) == str(sent_message["ephemeral"]), assert_fail_message("ephemeral")
|
||||||
if "rateLimitProof" in sent_message:
|
|
||||||
assert str(message.rateLimitProof) == str(sent_message["rateLimitProof"]), assert_fail_message("rateLimitProof")
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import inspect
|
import inspect
|
||||||
import os
|
import os
|
||||||
from datetime import datetime
|
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
from src.libs.custom_logger import get_custom_logger
|
from src.libs.custom_logger import get_custom_logger
|
||||||
|
@ -14,7 +13,6 @@ from src.env_vars import (
|
||||||
NODE_2,
|
NODE_2,
|
||||||
ADDITIONAL_NODES,
|
ADDITIONAL_NODES,
|
||||||
NODEKEY,
|
NODEKEY,
|
||||||
RUNNING_IN_CI,
|
|
||||||
DEFAULT_NWAKU,
|
DEFAULT_NWAKU,
|
||||||
RLN_CREDENTIALS,
|
RLN_CREDENTIALS,
|
||||||
)
|
)
|
||||||
|
@ -129,7 +127,7 @@ class StepsRelay:
|
||||||
# we need much bigger timeout in CI because we run tests in parallel there and the machine itself is slower
|
# we need much bigger timeout in CI because we run tests in parallel there and the machine itself is slower
|
||||||
@allure.step
|
@allure.step
|
||||||
def wait_for_published_message_to_reach_relay_peer(
|
def wait_for_published_message_to_reach_relay_peer(
|
||||||
self, timeout_duration=120 if RUNNING_IN_CI else 20, time_between_retries=1, pubsub_topic=None, sender=None, peer_list=None
|
self, timeout_duration=120, time_between_retries=1, pubsub_topic=None, sender=None, peer_list=None
|
||||||
):
|
):
|
||||||
@retry(stop=stop_after_delay(timeout_duration), wait=wait_fixed(time_between_retries), reraise=True)
|
@retry(stop=stop_after_delay(timeout_duration), wait=wait_fixed(time_between_retries), reraise=True)
|
||||||
def check_peer_connection():
|
def check_peer_connection():
|
||||||
|
@ -155,7 +153,7 @@ class StepsRelay:
|
||||||
return message
|
return message
|
||||||
|
|
||||||
@allure.step
|
@allure.step
|
||||||
@retry(stop=stop_after_delay(30), wait=wait_fixed(1), reraise=True)
|
@retry(stop=stop_after_delay(120), wait=wait_fixed(1), reraise=True)
|
||||||
def subscribe_and_publish_with_retry(self, node_list, pubsub_topic_list):
|
def subscribe_and_publish_with_retry(self, node_list, pubsub_topic_list):
|
||||||
self.ensure_relay_subscriptions_on_nodes(node_list, pubsub_topic_list)
|
self.ensure_relay_subscriptions_on_nodes(node_list, pubsub_topic_list)
|
||||||
self.check_published_message_reaches_relay_peer()
|
self.check_published_message_reaches_relay_peer()
|
||||||
|
|
|
@ -39,11 +39,10 @@ class TestFilterGetMessages(StepsFilter):
|
||||||
def test_filter_get_message_with_version(self):
|
def test_filter_get_message_with_version(self):
|
||||||
self.check_published_message_reaches_filter_peer(self.create_message(version=10))
|
self.check_published_message_reaches_filter_peer(self.create_message(version=10))
|
||||||
|
|
||||||
@pytest.mark.xfail("nwaku" in NODE_1 or "nwaku" in NODE_2, reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
|
|
||||||
def test_filter_get_message_with_meta(self):
|
def test_filter_get_message_with_meta(self):
|
||||||
self.check_published_message_reaches_filter_peer(self.create_message(meta=to_base64(self.test_payload)))
|
self.check_published_message_reaches_filter_peer(self.create_message(meta=to_base64(self.test_payload)))
|
||||||
|
|
||||||
@pytest.mark.xfail(reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
|
@pytest.mark.xfail(reason="Bug reported: https://github.com/waku-org/nwaku/issues/2436")
|
||||||
def test_filter_get_message_with_ephemeral(self):
|
def test_filter_get_message_with_ephemeral(self):
|
||||||
failed_ephemeral = []
|
failed_ephemeral = []
|
||||||
for ephemeral in [True, False]:
|
for ephemeral in [True, False]:
|
||||||
|
@ -55,15 +54,6 @@ class TestFilterGetMessages(StepsFilter):
|
||||||
failed_ephemeral.append(ephemeral)
|
failed_ephemeral.append(ephemeral)
|
||||||
assert not failed_ephemeral, f"Ephemeral that failed: {failed_ephemeral}"
|
assert not failed_ephemeral, f"Ephemeral that failed: {failed_ephemeral}"
|
||||||
|
|
||||||
@pytest.mark.xfail(reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
|
|
||||||
def test_filter_get_message_with_rate_limit_proof(self):
|
|
||||||
rate_limit_proof = {
|
|
||||||
"proof": to_base64("proofData"),
|
|
||||||
"epoch": to_base64("epochData"),
|
|
||||||
"nullifier": to_base64("nullifierData"),
|
|
||||||
}
|
|
||||||
self.check_published_message_reaches_filter_peer(self.create_message(rateLimitProof=rate_limit_proof))
|
|
||||||
|
|
||||||
def test_filter_get_message_with_extra_field(self):
|
def test_filter_get_message_with_extra_field(self):
|
||||||
try:
|
try:
|
||||||
self.check_published_message_reaches_filter_peer(self.create_message(extraField="extraValue"))
|
self.check_published_message_reaches_filter_peer(self.create_message(extraField="extraValue"))
|
||||||
|
|
|
@ -32,4 +32,4 @@ class TestRelayMultipleNodes(StepsRelay):
|
||||||
def test_relay_get_message_after_one_peer_was_stopped(self, subscribe_optional_relay_nodes, relay_warm_up):
|
def test_relay_get_message_after_one_peer_was_stopped(self, subscribe_optional_relay_nodes, relay_warm_up):
|
||||||
self.check_published_message_reaches_relay_peer(peer_list=self.main_nodes + self.optional_nodes)
|
self.check_published_message_reaches_relay_peer(peer_list=self.main_nodes + self.optional_nodes)
|
||||||
self.node2.stop()
|
self.node2.stop()
|
||||||
self.check_published_message_reaches_relay_peer(peer_list=self.optional_nodes)
|
self.wait_for_published_message_to_reach_relay_peer(peer_list=self.optional_nodes)
|
||||||
|
|
|
@ -158,7 +158,6 @@ class TestRelayPublish(StepsRelay):
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
assert "Bad Request" in str(ex)
|
assert "Bad Request" in str(ex)
|
||||||
|
|
||||||
@pytest.mark.xfail("nwaku" in NODE_1 or "nwaku" in NODE_2, reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
|
|
||||||
def test_publish_with_valid_meta(self):
|
def test_publish_with_valid_meta(self):
|
||||||
self.check_published_message_reaches_relay_peer(self.create_message(meta=to_base64(self.test_payload)))
|
self.check_published_message_reaches_relay_peer(self.create_message(meta=to_base64(self.test_payload)))
|
||||||
|
|
||||||
|
@ -169,7 +168,7 @@ class TestRelayPublish(StepsRelay):
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
assert "Bad Request" in str(ex)
|
assert "Bad Request" in str(ex)
|
||||||
|
|
||||||
@pytest.mark.xfail(reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
|
@pytest.mark.xfail(reason="Bug reported: https://github.com/waku-org/nwaku/issues/2436")
|
||||||
def test_publish_with_ephemeral(self):
|
def test_publish_with_ephemeral(self):
|
||||||
failed_ephemeral = []
|
failed_ephemeral = []
|
||||||
for ephemeral in [True, False]:
|
for ephemeral in [True, False]:
|
||||||
|
@ -181,15 +180,6 @@ class TestRelayPublish(StepsRelay):
|
||||||
failed_ephemeral.append(ephemeral)
|
failed_ephemeral.append(ephemeral)
|
||||||
assert not failed_ephemeral, f"Ephemeral that failed: {failed_ephemeral}"
|
assert not failed_ephemeral, f"Ephemeral that failed: {failed_ephemeral}"
|
||||||
|
|
||||||
@pytest.mark.xfail(reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
|
|
||||||
def test_publish_with_rate_limit_proof(self):
|
|
||||||
rate_limit_proof = {
|
|
||||||
"proof": to_base64("proofData"),
|
|
||||||
"epoch": to_base64("epochData"),
|
|
||||||
"nullifier": to_base64("nullifierData"),
|
|
||||||
}
|
|
||||||
self.check_published_message_reaches_relay_peer(self.create_message(rateLimitProof=rate_limit_proof))
|
|
||||||
|
|
||||||
def test_publish_with_extra_field(self):
|
def test_publish_with_extra_field(self):
|
||||||
try:
|
try:
|
||||||
self.check_published_message_reaches_relay_peer(self.create_message(extraField="extraValue"))
|
self.check_published_message_reaches_relay_peer(self.create_message(extraField="extraValue"))
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import pytest
|
import pytest
|
||||||
|
from src.env_vars import NODE_2
|
||||||
from src.libs.custom_logger import get_custom_logger
|
from src.libs.custom_logger import get_custom_logger
|
||||||
from src.steps.relay import StepsRelay
|
from src.steps.relay import StepsRelay
|
||||||
from src.test_data import INVALID_PUBSUB_TOPICS, VALID_PUBSUB_TOPICS
|
from src.test_data import INVALID_PUBSUB_TOPICS, VALID_PUBSUB_TOPICS
|
||||||
|
@ -47,6 +48,7 @@ class TestRelaySubscribe(StepsRelay):
|
||||||
self.delete_relay_subscriptions_on_nodes(self.main_nodes, [self.test_pubsub_topic])
|
self.delete_relay_subscriptions_on_nodes(self.main_nodes, [self.test_pubsub_topic])
|
||||||
self.check_publish_without_relay_subscription(self.test_pubsub_topic)
|
self.check_publish_without_relay_subscription(self.test_pubsub_topic)
|
||||||
|
|
||||||
|
@pytest.mark.xfail("go-waku" in NODE_2, reason="Bug reported: https://github.com/waku-org/go-waku/issues/1034")
|
||||||
def test_relay_unsubscribe_from_all_pubsub_topics(self):
|
def test_relay_unsubscribe_from_all_pubsub_topics(self):
|
||||||
self.ensure_relay_subscriptions_on_nodes(self.main_nodes, VALID_PUBSUB_TOPICS)
|
self.ensure_relay_subscriptions_on_nodes(self.main_nodes, VALID_PUBSUB_TOPICS)
|
||||||
for pubsub_topic in VALID_PUBSUB_TOPICS:
|
for pubsub_topic in VALID_PUBSUB_TOPICS:
|
||||||
|
|
Loading…
Reference in New Issue