diff --git a/src/env_vars.py b/src/env_vars.py index 0d20c276..cac65728 100644 --- a/src/env_vars.py +++ b/src/env_vars.py @@ -25,7 +25,6 @@ NETWORK_NAME = get_env_var("NETWORK_NAME", "waku") SUBNET = get_env_var("SUBNET", "172.18.0.0/16") IP_RANGE = get_env_var("IP_RANGE", "172.18.0.0/24") GATEWAY = get_env_var("GATEWAY", "172.18.0.1") -DEFAULT_PUBSUB_TOPIC = get_env_var("DEFAULT_PUBSUB_TOPIC", "/waku/2/default-waku/proto") RUNNING_IN_CI = get_env_var("CI") NODEKEY = get_env_var("NODEKEY", "30348dd51465150e04a5d9d932c72864c8967f806cce60b5d26afeca1e77eb68") API_REQUEST_TIMEOUT = get_env_var("API_REQUEST_TIMEOUT", 10) diff --git a/src/steps/filter.py b/src/steps/filter.py index 6cfdb2a7..f457ae07 100644 --- a/src/steps/filter.py +++ b/src/steps/filter.py @@ -175,7 +175,6 @@ class StepsFilter: node = self.node2 ping_sub_response = node.ping_filter_subscriptions(request_id) assert ping_sub_response["requestId"] == request_id - assert ping_sub_response["statusCode"] == 0 assert ping_sub_response["statusDesc"] in ["OK", ""] # until https://github.com/waku-org/nwaku/issues/2286 is fixed def ping_without_filter_subscription(self, node=None): diff --git a/src/test_data.py b/src/test_data.py index a1bf381c..3eb19522 100644 --- a/src/test_data.py +++ b/src/test_data.py @@ -1,8 +1,6 @@ from time import time from datetime import datetime, timedelta -from src.env_vars import DEFAULT_PUBSUB_TOPIC - NOW = datetime.now() SAMPLE_INPUTS = [ @@ -65,7 +63,7 @@ INVALID_CONTENT_TOPICS = [ {"description": "A bool", "value": True}, ] -VALID_PUBSUB_TOPICS = ["/waku/2/rs/0/0", "/waku/2/rs/0/1", "/waku/2/rs/0/9", "/waku/2/rs/0/25", "/waku/2/rs/0/1000", DEFAULT_PUBSUB_TOPIC] +VALID_PUBSUB_TOPICS = ["/waku/2/rs/0/0", "/waku/2/rs/0/1", "/waku/2/rs/0/9", "/waku/2/rs/0/25", "/waku/2/rs/0/1000"] INVALID_PUBSUB_TOPICS = ["/test/2/rs/0/1", "/waku/3/rs/0/1", "/waku/2/test/0/1", "/waku/2/rs/0/b", "/waku/2/rs/0"] diff --git a/tests/filter/test_get_messages.py b/tests/filter/test_get_messages.py index 18485332..2b926550 100644 --- a/tests/filter/test_get_messages.py +++ b/tests/filter/test_get_messages.py @@ -1,4 +1,5 @@ import pytest +from src.env_vars import NODE_1 from src.libs.common import delay, to_base64 from src.libs.custom_logger import get_custom_logger from src.test_data import SAMPLE_INPUTS, SAMPLE_TIMESTAMPS @@ -38,9 +39,11 @@ 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, 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") def test_filter_get_message_with_ephemeral(self): failed_ephemeral = [] for ephemeral in [True, False]: @@ -52,6 +55,7 @@ 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"), @@ -106,6 +110,7 @@ class TestFilterGetMessages(StepsFilter): self.wait_for_subscriptions_on_main_nodes([self.test_content_topic]) self.check_published_message_reaches_filter_peer() + @pytest.mark.flaky(reruns=5) def test_filter_get_50_messages(self): num_messages = 50 for index in range(num_messages): diff --git a/tests/filter/test_multiple_nodes.py b/tests/filter/test_multiple_nodes.py index dbbd3fca..8e6acde4 100644 --- a/tests/filter/test_multiple_nodes.py +++ b/tests/filter/test_multiple_nodes.py @@ -1,4 +1,5 @@ import pytest +from src.env_vars import NODE_1 from src.libs.common import delay from src.libs.custom_logger import get_custom_logger from src.steps.filter import StepsFilter @@ -21,6 +22,7 @@ class TestFilterMultipleNodes(StepsFilter): self.check_published_message_reaches_filter_peer(peer_list=self.main_nodes) self.check_publish_without_filter_subscription(peer_list=self.optional_nodes) + @pytest.mark.xfail("nwaku" in NODE_1, reason="Bug reported: https://github.com/waku-org/nwaku/issues/2319") def test_filter_get_message_while_one_peer_is_paused(self): self.setup_optional_filter_nodes() self.wait_for_subscriptions_on_main_nodes([self.test_content_topic]) @@ -36,6 +38,7 @@ class TestFilterMultipleNodes(StepsFilter): filter_messages = self.get_filter_messages(content_topic=self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node2) assert len(filter_messages) == 2, "Both messages should've been returned" + @pytest.mark.xfail("nwaku" in NODE_1, reason="Bug reported: https://github.com/waku-org/nwaku/issues/2319") def test_filter_get_message_after_one_peer_was_stopped(self): self.setup_optional_filter_nodes() self.wait_for_subscriptions_on_main_nodes([self.test_content_topic]) diff --git a/tests/filter/test_subscribe_create.py b/tests/filter/test_subscribe_create.py index d3659690..931f30ef 100644 --- a/tests/filter/test_subscribe_create.py +++ b/tests/filter/test_subscribe_create.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.test_data import INVALID_CONTENT_TOPICS, SAMPLE_INPUTS, VALID_PUBSUB_TOPICS from src.steps.filter import StepsFilter @@ -30,6 +31,7 @@ class TestFilterSubscribeCreate(StepsFilter): self.wait_for_subscriptions_on_main_nodes([self.test_content_topic], pubsub_topic=self.another_cluster_pubsub_topic) self.check_published_message_reaches_filter_peer(pubsub_topic=self.another_cluster_pubsub_topic) + @pytest.mark.xfail("go-waku" in NODE_2, reason="Bug reported: https://github.com/waku-org/nwaku/issues/2319") def test_filter_subscribe_to_pubsub_topics_from_multiple_clusters(self): pubsub_topic_list = [self.test_pubsub_topic, self.another_cluster_pubsub_topic, self.second_pubsub_topic] failed_pubsub_topics = [] @@ -98,7 +100,7 @@ class TestFilterSubscribeCreate(StepsFilter): self.create_filter_subscription({"requestId": "1", "contentFilters": [self.test_content_topic]}) # raise AssertionError("Subscribe with no pubusub topics worked!!!") commented until https://github.com/waku-org/nwaku/issues/2315 is fixed except Exception as ex: - assert "Bad Request" in str(ex) + assert "Bad Request" in str(ex) or "timed out" in str(ex) def test_filter_subscribe_with_invalid_pubsub_topic_format(self, subscribe_main_nodes): try: diff --git a/tests/relay/test_publish.py b/tests/relay/test_publish.py index 19765df1..add9261f 100644 --- a/tests/relay/test_publish.py +++ b/tests/relay/test_publish.py @@ -1,4 +1,5 @@ import pytest +from src.env_vars import NODE_1 from src.libs.custom_logger import get_custom_logger from time import time from src.libs.common import delay, to_base64 @@ -157,6 +158,7 @@ class TestRelayPublish(StepsRelay): except Exception as ex: assert "Bad Request" in str(ex) + @pytest.mark.xfail("nwaku" in NODE_1, 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))) @@ -167,6 +169,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") def test_publish_with_ephemeral(self): failed_ephemeral = [] for ephemeral in [True, False]: @@ -178,6 +181,7 @@ 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"), @@ -242,6 +246,7 @@ class TestRelayPublish(StepsRelay): self.ensure_relay_subscriptions_on_nodes(self.main_nodes, [self.test_pubsub_topic]) self.wait_for_published_message_to_reach_relay_peer() + @pytest.mark.flaky(reruns=5) def test_publish_and_retrieve_100_messages(self): num_messages = 100 # if increase this number make sure to also increase rest-relay-cache-capacity flag for index in range(num_messages): diff --git a/tests/relay/test_subscribe.py b/tests/relay/test_subscribe.py index 0b25a7c9..3c6ef0e1 100644 --- a/tests/relay/test_subscribe.py +++ b/tests/relay/test_subscribe.py @@ -1,5 +1,4 @@ import pytest -from src.env_vars import DEFAULT_PUBSUB_TOPIC 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 @@ -99,12 +98,3 @@ class TestRelaySubscribe(StepsRelay): self.check_publish_without_relay_subscription(self.test_pubsub_topic) self.ensure_relay_subscriptions_on_nodes(self.main_nodes, [self.test_pubsub_topic]) self.check_published_message_reaches_relay_peer() - - def test_relay_publish_on_default_pubsub_topic_without_beeing_subscribed_to_it(self): - self.ensure_relay_subscriptions_on_nodes(self.main_nodes, [self.test_pubsub_topic]) - self.wait_for_published_message_to_reach_relay_peer() - try: - self.check_published_message_reaches_relay_peer(pubsub_topic=DEFAULT_PUBSUB_TOPIC) - raise AssertionError(f"Publish on {DEFAULT_PUBSUB_TOPIC} with beeing subscribed to it worked!!!") - except Exception as ex: - assert "Not Found" in str(ex)