From 98c76dc214bb7a8ec52d22f44c5ebb3cbff73c3e Mon Sep 17 00:00:00 2001 From: Florin Barbu Date: Thu, 15 Feb 2024 14:58:20 +0200 Subject: [PATCH] fixes for latest failures and bugfixes (#17) * fixes for latest failures and bugfixes * other fixes --- src/node/waku_message.py | 2 -- src/steps/relay.py | 6 ++---- tests/filter/test_get_messages.py | 12 +----------- tests/relay/test_multiple_nodes.py | 2 +- tests/relay/test_publish.py | 12 +----------- tests/relay/test_subscribe.py | 2 ++ 6 files changed, 7 insertions(+), 29 deletions(-) diff --git a/src/node/waku_message.py b/src/node/waku_message.py index c3b6f15fe7..76b29ae87a 100644 --- a/src/node/waku_message.py +++ b/src/node/waku_message.py @@ -44,5 +44,3 @@ class WakuMessage: 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") diff --git a/src/steps/relay.py b/src/steps/relay.py index ac042d588f..8ed7b55ed3 100644 --- a/src/steps/relay.py +++ b/src/steps/relay.py @@ -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 @@ -14,7 +13,6 @@ from src.env_vars import ( NODE_2, ADDITIONAL_NODES, NODEKEY, - RUNNING_IN_CI, DEFAULT_NWAKU, 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 @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(): @@ -155,7 +153,7 @@ class StepsRelay: 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() diff --git a/tests/filter/test_get_messages.py b/tests/filter/test_get_messages.py index f5f7a36cdd..6aab15f1b1 100644 --- a/tests/filter/test_get_messages.py +++ b/tests/filter/test_get_messages.py @@ -39,11 +39,10 @@ class TestFilterGetMessages(StepsFilter): 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]: @@ -55,15 +54,6 @@ class TestFilterGetMessages(StepsFilter): 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")) diff --git a/tests/relay/test_multiple_nodes.py b/tests/relay/test_multiple_nodes.py index e8695ac84d..3bb007f14f 100644 --- a/tests/relay/test_multiple_nodes.py +++ b/tests/relay/test_multiple_nodes.py @@ -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): 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) diff --git a/tests/relay/test_publish.py b/tests/relay/test_publish.py index e1c2b2c5e6..ac683d9e45 100644 --- a/tests/relay/test_publish.py +++ b/tests/relay/test_publish.py @@ -158,7 +158,6 @@ class TestRelayPublish(StepsRelay): 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))) @@ -169,7 +168,7 @@ class TestRelayPublish(StepsRelay): 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]: @@ -181,15 +180,6 @@ class TestRelayPublish(StepsRelay): 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")) diff --git a/tests/relay/test_subscribe.py b/tests/relay/test_subscribe.py index 3c6ef0e1bb..2101813726 100644 --- a/tests/relay/test_subscribe.py +++ b/tests/relay/test_subscribe.py @@ -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 @@ -47,6 +48,7 @@ class TestRelaySubscribe(StepsRelay): 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: