From a8ed2e8856c3a4884c917ba01346864148987083 Mon Sep 17 00:00:00 2001 From: fbarbu15 Date: Tue, 8 Jul 2025 18:28:00 +0300 Subject: [PATCH] chore: fix interop tests (#128) --- tests/e2e/test_e2e.py | 11 +---------- tests/sharding/test_running_nodes_auto_sharding.py | 12 ++---------- tests/sharding/test_running_nodes_static_sharding.py | 2 +- tests/store/test_get_messages.py | 7 ------- tests/store_sync/test_store_sync.py | 1 + 5 files changed, 5 insertions(+), 28 deletions(-) diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index 3125a260..0aef1e73 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -473,7 +473,6 @@ class TestE2E(StepsFilter, StepsStore, StepsRelay, StepsLightPush): assert len(messages_response) == 1, "message counter isn't as expected " def test_store_no_peer_selected(self): - store_version = "v3" logger.debug("Start 5 nodes") self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") self.node5 = WakuNode(NODE_2, f"node4_{self.test_id}") @@ -501,14 +500,6 @@ class TestE2E(StepsFilter, StepsStore, StepsRelay, StepsLightPush): self.publish_message(sender=self.node4) logger.debug("Check if node3 can inquiry stored message without stor peer specified") store_response = self.node3.get_store_messages( - pubsub_topic=self.test_pubsub_topic, content_topics=self.test_content_topic, page_size=5, ascending="true", store_v=store_version + pubsub_topic=self.test_pubsub_topic, content_topics=self.test_content_topic, page_size=5, ascending="true" ) assert len(store_response["messages"]) == 1, "Can't find stored message!!" - - logger.debug("Repeat publish and store inquiry but using store v1") - store_version = "v1" - self.publish_message(sender=self.node4) - - logger.debug("Check if node3 can inquiry stored message without stor peer specified") - store_response = self.node3.get_store_messages(pubsub_topic=self.test_pubsub_topic, page_size=5, ascending="true", store_v=store_version) - assert len(store_response["messages"]) == 2, "Can't find stored message!!" diff --git a/tests/sharding/test_running_nodes_auto_sharding.py b/tests/sharding/test_running_nodes_auto_sharding.py index d231e114..23c5bbce 100644 --- a/tests/sharding/test_running_nodes_auto_sharding.py +++ b/tests/sharding/test_running_nodes_auto_sharding.py @@ -37,22 +37,14 @@ class TestRunningNodesAutosharding(StepsSharding): self.setup_second_relay_node(cluster_id=self.auto_cluster, content_topic="/newsService/1.0/alerts/xml") self.subscribe_first_relay_node(content_topics=["/newsService/1.0/weekly/protobuf"]) self.subscribe_second_relay_node(content_topics=["/newsService/1.0/alerts/xml"]) - try: - self.check_published_message_reaches_relay_peer(content_topic="/newsService/1.0/weekly/protobuf") - raise AssertionError("Publish on different content topic worked!!!") - except Exception as ex: - assert "Not Found" in str(ex) + self.check_published_message_reaches_relay_peer(content_topic="/newsService/1.0/weekly/protobuf") def test_2_nodes_different_content_topic_different_shard(self): self.setup_first_relay_node_with_filter(cluster_id=self.auto_cluster, content_topic="/myapp/1/latest/proto") self.setup_second_relay_node(cluster_id=self.auto_cluster, content_topic="/waku/2/content/test.js") self.subscribe_first_relay_node(content_topics=["/myapp/1/latest/proto"]) self.subscribe_second_relay_node(content_topics=["/waku/2/content/test.js"]) - try: - self.check_published_message_reaches_relay_peer(content_topic="/myapp/1/latest/proto") - raise AssertionError("Publish on different content topic worked!!!") - except Exception as ex: - assert "Not Found" in str(ex) + self.check_published_message_reaches_relay_peer(content_topic="/myapp/1/latest/proto") def test_content_topic_not_in_docker_flags(self): self.setup_main_relay_nodes(cluster_id=2, pubsub_topic=self.test_pubsub_topic) diff --git a/tests/sharding/test_running_nodes_static_sharding.py b/tests/sharding/test_running_nodes_static_sharding.py index 1062b72b..fd4782f6 100644 --- a/tests/sharding/test_running_nodes_static_sharding.py +++ b/tests/sharding/test_running_nodes_static_sharding.py @@ -10,7 +10,7 @@ logger = get_custom_logger(__name__) class TestRunningNodesStaticSharding(StepsSharding): @pytest.mark.parametrize("pubsub_topic", PUBSUB_TOPICS_DIFFERENT_CLUSTERS) def test_single_pubsub_topic(self, pubsub_topic): - self.setup_main_relay_nodes(pubsub_topic=pubsub_topic, shard=["0", "1", "999"]) + self.setup_main_relay_nodes(pubsub_topic=pubsub_topic) self.subscribe_main_relay_nodes(pubsub_topics=[pubsub_topic]) self.check_published_message_reaches_relay_peer(pubsub_topic=pubsub_topic) diff --git a/tests/store/test_get_messages.py b/tests/store/test_get_messages.py index b90d6ef6..1af7f85a 100644 --- a/tests/store/test_get_messages.py +++ b/tests/store/test_get_messages.py @@ -10,13 +10,6 @@ logger = get_custom_logger(__name__) @pytest.mark.usefixtures("node_setup") class TestGetMessages(StepsStore): - # only one test for store v1, all other tests are using the new store v3 - def test_legacy_store_v1(self): - self.publish_message() - for node in self.store_nodes: - store_response = node.get_store_messages(pubsub_topic=self.test_pubsub_topic, page_size=5, ascending="true", store_v="v1") - assert len(store_response["messages"]) == 1 - def test_get_store_messages_with_different_payloads(self): failed_payloads = [] for payload in SAMPLE_INPUTS: diff --git a/tests/store_sync/test_store_sync.py b/tests/store_sync/test_store_sync.py index 1ca7e9d9..ac69feab 100644 --- a/tests/store_sync/test_store_sync.py +++ b/tests/store_sync/test_store_sync.py @@ -21,6 +21,7 @@ class TestStoreSync(StepsStore): self.node3 = WakuNode(NODE_1, f"node3_{self.test_id}") self.num_messages = 10 + @pytest.mark.skip("This test doesn not work as expected, will be fixed by @aya") def test_sync_nodes_are_relay(self): self.node1.start(store="true", relay="true") self.node2.start(store="false", store_sync="true", relay="true", discv5_bootstrap_node=self.node1.get_enr_uri())