Skip to content

Commit

Permalink
fixes for latest failures and bugfixes (#17)
Browse files Browse the repository at this point in the history
* fixes for latest failures and bugfixes

* other fixes
  • Loading branch information
fbarbu15 authored Feb 15, 2024
1 parent 8cb44f1 commit 98c76dc
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 29 deletions.
2 changes: 0 additions & 2 deletions src/node/waku_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,3 @@ def assert_fail_message(field_name):
assert str(message.meta) == str(sent_message["meta"]), assert_fail_message("meta")
if "ephemeral" in sent_message:
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")
6 changes: 2 additions & 4 deletions src/steps/relay.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import inspect
import os
from datetime import datetime
from uuid import uuid4

from src.libs.custom_logger import get_custom_logger
Expand All @@ -14,7 +13,6 @@
NODE_2,
ADDITIONAL_NODES,
NODEKEY,
RUNNING_IN_CI,
DEFAULT_NWAKU,
RLN_CREDENTIALS,
)
Expand Down Expand Up @@ -129,7 +127,7 @@ def check_publish_without_relay_subscription(self, pubsub_topic):
# we need much bigger timeout in CI because we run tests in parallel there and the machine itself is slower
@allure.step
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)
def check_peer_connection():
Expand All @@ -155,7 +153,7 @@ def create_message(self, **kwargs):
return message

@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):
self.ensure_relay_subscriptions_on_nodes(node_list, pubsub_topic_list)
self.check_published_message_reaches_relay_peer()
Expand Down
12 changes: 1 addition & 11 deletions tests/filter/test_get_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ def test_filter_get_message_with_valid_timestamps(self):
def test_filter_get_message_with_version(self):
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):
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):
failed_ephemeral = []
for ephemeral in [True, False]:
Expand All @@ -55,15 +54,6 @@ def test_filter_get_message_with_ephemeral(self):
failed_ephemeral.append(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):
try:
self.check_published_message_reaches_filter_peer(self.create_message(extraField="extraValue"))
Expand Down
2 changes: 1 addition & 1 deletion tests/relay/test_multiple_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ def test_relay_get_message_while_one_peer_is_paused(self, subscribe_optional_rel
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.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)
12 changes: 1 addition & 11 deletions tests/relay/test_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ def test_publish_with_invalid_version(self):
except Exception as 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):
self.check_published_message_reaches_relay_peer(self.create_message(meta=to_base64(self.test_payload)))

Expand All @@ -169,7 +168,7 @@ def test_publish_with_invalid_meta(self):
except Exception as 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):
failed_ephemeral = []
for ephemeral in [True, False]:
Expand All @@ -181,15 +180,6 @@ def test_publish_with_ephemeral(self):
failed_ephemeral.append(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):
try:
self.check_published_message_reaches_relay_peer(self.create_message(extraField="extraValue"))
Expand Down
2 changes: 2 additions & 0 deletions tests/relay/test_subscribe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
from src.env_vars import NODE_2
from src.libs.custom_logger import get_custom_logger
from src.steps.relay import StepsRelay
from src.test_data import INVALID_PUBSUB_TOPICS, VALID_PUBSUB_TOPICS
Expand Down Expand Up @@ -47,6 +48,7 @@ def test_relay_unsubscribe_from_single_pubsub_topic(self):
self.delete_relay_subscriptions_on_nodes(self.main_nodes, [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):
self.ensure_relay_subscriptions_on_nodes(self.main_nodes, VALID_PUBSUB_TOPICS)
for pubsub_topic in VALID_PUBSUB_TOPICS:
Expand Down

0 comments on commit 98c76dc

Please sign in to comment.