From 63348d6a16523793303b83de35a5152376772e17 Mon Sep 17 00:00:00 2001 From: aya Date: Wed, 30 Oct 2024 18:01:12 +0300 Subject: [PATCH 01/23] add draft test case --- tests/e2e/test_e2e.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index 6a9bcc9492..6fa179a9fd 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -177,3 +177,31 @@ def test_chain_of_relay_nodes(self): # self.node1 relays and we check that self.node10 receives the message self.check_published_message_reaches_relay_peer(sender=self.node1, peer_list=[self.node10], message_propagation_delay=1) + + +def test_temp_test(self): + self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") + self.node5 = WakuNode(NODE_2, f"node3_{self.test_id}") + + self.node1.start(relay="true", store="true") + self.node2.start(relay="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) + self.node3.start(relay="true", store="false", filter="true", discv5_bootstrap_node=self.node2.get_enr_uri()) + self.node4.start( + relay="false", filter="true", filternode=self.node3.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node3.get_enr_uri() + ) + # self.node5.start(relay="false", filter="true",filternode=self.node3.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node3.get_enr_uri()) + + logger.debug("Subscribe nodes to relay pubsub topics") + self.node1.set_relay_subscriptions([self.test_pubsub_topic]) + self.node2.set_relay_subscriptions([self.test_pubsub_topic]) + self.node3.set_relay_subscriptions([self.test_pubsub_topic]) + delay(5) + self.node4.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) + delay(2) + self.publish_message(sender=self.node1, pubsub_topic=self.test_pubsub_topic, message=self.create_message()) + delay(3) + self.publish_message(sender=self.node2, pubsub_topic=self.test_pubsub_topic, message=self.create_message(payload=to_base64("dummy"))) + delay(2) + messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node4) + + logger.debug(f"Response for node 6 is {messages_response}") From a4065861a7f559283e2ffe7db66f223cb1c54ead Mon Sep 17 00:00:00 2001 From: aya Date: Thu, 31 Oct 2024 09:20:29 +0300 Subject: [PATCH 02/23] Adding test test_filter_3_senders_1_receiver --- tests/e2e/test_e2e.py | 57 +++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index 6fa179a9fd..4fd9f931da 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -178,30 +178,35 @@ def test_chain_of_relay_nodes(self): # self.node1 relays and we check that self.node10 receives the message self.check_published_message_reaches_relay_peer(sender=self.node1, peer_list=[self.node10], message_propagation_delay=1) + def test_filter_3_senders_1_receiver(self): + self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") + self.node5 = WakuNode(NODE_2, f"node3_{self.test_id}") + + logger.debug("Start 5 nodes") + self.node1.start(relay="true", store="true") + self.node2.start(relay="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) + self.node3.start(relay="true", store="true", filter="true", discv5_bootstrap_node=self.node2.get_enr_uri()) + self.node4.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node3.get_enr_uri()) + self.node5.start( + relay="false", filter="true", filternode=self.node4.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node3.get_enr_uri() + ) + + logger.debug(f"Subscribe nodes to relay pubsub topic {self.test_pubsub_topic}") + node_list = [self.node1, self.node2, self.node3, self.node4] + for node in node_list: + node.set_relay_subscriptions([self.test_pubsub_topic]) + self.wait_for_autoconnection(node_list, hard_wait=30) + + logger.debug(f"Node5 make filter request pubtopic {self.test_pubsub_topic} " f"{self.test_content_topic}and content topic ") + self.node5.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) + delay(1) + + logger.debug("3 Nodes publish 3 messages") + for node in node_list[:-1]: + self.publish_message(sender=node, pubsub_topic=self.test_pubsub_topic, message=self.create_message()) + delay(1) -def test_temp_test(self): - self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") - self.node5 = WakuNode(NODE_2, f"node3_{self.test_id}") - - self.node1.start(relay="true", store="true") - self.node2.start(relay="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) - self.node3.start(relay="true", store="false", filter="true", discv5_bootstrap_node=self.node2.get_enr_uri()) - self.node4.start( - relay="false", filter="true", filternode=self.node3.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node3.get_enr_uri() - ) - # self.node5.start(relay="false", filter="true",filternode=self.node3.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node3.get_enr_uri()) - - logger.debug("Subscribe nodes to relay pubsub topics") - self.node1.set_relay_subscriptions([self.test_pubsub_topic]) - self.node2.set_relay_subscriptions([self.test_pubsub_topic]) - self.node3.set_relay_subscriptions([self.test_pubsub_topic]) - delay(5) - self.node4.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) - delay(2) - self.publish_message(sender=self.node1, pubsub_topic=self.test_pubsub_topic, message=self.create_message()) - delay(3) - self.publish_message(sender=self.node2, pubsub_topic=self.test_pubsub_topic, message=self.create_message(payload=to_base64("dummy"))) - delay(2) - messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node4) - - logger.debug(f"Response for node 6 is {messages_response}") + logger.debug("Node5 requests messages of subscribed filter topic") + messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node5) + logger.debug(f"Response for node 5 is {len(messages_response)}") + assert len(messages_response) == 3, "Received messages != published !!" From 40fa4a34114d1260706c75100555a2c11ece7f04 Mon Sep 17 00:00:00 2001 From: aya Date: Thu, 31 Oct 2024 12:30:42 +0300 Subject: [PATCH 03/23] Adding test test_filter_3_senders_45_msg_1_receiver --- tests/e2e/test_e2e.py | 76 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index 4fd9f931da..6e963788f0 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -178,7 +178,42 @@ def test_chain_of_relay_nodes(self): # self.node1 relays and we check that self.node10 receives the message self.check_published_message_reaches_relay_peer(sender=self.node1, peer_list=[self.node10], message_propagation_delay=1) + def test_filter_3_senders_3_msg_1_receiver(self): + messages_num = 3 + self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") + self.node5 = WakuNode(NODE_2, f"node3_{self.test_id}") + + logger.debug("Start 5 nodes") + self.node1.start(relay="true", store="true") + self.node2.start(relay="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) + self.node3.start(relay="true", store="true", filter="true", discv5_bootstrap_node=self.node2.get_enr_uri()) + self.node4.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node3.get_enr_uri()) + self.node5.start( + relay="false", filter="true", filternode=self.node4.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node3.get_enr_uri() + ) + + logger.debug(f"Subscribe nodes to relay pubsub topic {self.test_pubsub_topic}") + node_list = [self.node1, self.node2, self.node3, self.node4] + for node in node_list: + node.set_relay_subscriptions([self.test_pubsub_topic]) + self.wait_for_autoconnection(node_list, hard_wait=30) + + logger.debug(f"Node5 make filter request pubtopic {self.test_pubsub_topic} " f"{self.test_content_topic}and content topic ") + self.node5.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) + delay(1) + + logger.debug("3 Nodes publish 3 messages") + for node in node_list[:-1]: + self.publish_message(sender=node, pubsub_topic=self.test_pubsub_topic, message=self.create_message()) + delay(1) + + logger.debug("Node5 requests messages of subscribed filter topic") + messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node5) + logger.debug(f"Response for node 5 is {len(messages_response)}") + assert len(messages_response) == messages_num, f"Received messages != published which is{messages_num} !!" + def test_filter_3_senders_1_receiver(self): + messages_num = 3 self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") self.node5 = WakuNode(NODE_2, f"node3_{self.test_id}") @@ -206,7 +241,46 @@ def test_filter_3_senders_1_receiver(self): self.publish_message(sender=node, pubsub_topic=self.test_pubsub_topic, message=self.create_message()) delay(1) + delay(250) + logger.debug("Node5 requests messages of subscribed filter topic") + messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node5) + + delay(250) + messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node5) + logger.debug(f"Response for node 5 is {len(messages_response)}") + assert len(messages_response) == messages_num, f"Received messages != published which is{messages_num} !!" + + def test_filter_3_senders_45_msg_1_receiver(self): + messages_num = 45 + self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") + self.node5 = WakuNode(NODE_2, f"node3_{self.test_id}") + + logger.debug("Start 5 nodes") + self.node1.start(relay="true", store="true") + self.node2.start(relay="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) + self.node3.start(relay="true", store="true", filter="true", discv5_bootstrap_node=self.node2.get_enr_uri()) + self.node4.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node3.get_enr_uri()) + self.node5.start( + relay="false", filter="true", filternode=self.node4.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node3.get_enr_uri() + ) + + logger.debug(f"Subscribe nodes to relay pubsub topic {self.test_pubsub_topic}") + node_list = [self.node1, self.node2, self.node3, self.node4] + for node in node_list: + node.set_relay_subscriptions([self.test_pubsub_topic]) + self.wait_for_autoconnection(node_list, hard_wait=30) + + logger.debug(f"Node5 make filter request pubtopic {self.test_pubsub_topic} " f"{self.test_content_topic}and content topic ") + self.node5.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) + delay(1) + + logger.debug("3 Nodes publish 45 message") + for node in node_list[:-1]: + for i in range(15): + self.publish_message(sender=node, pubsub_topic=self.test_pubsub_topic, message=self.create_message()) + delay(0.2) + logger.debug("Node5 requests messages of subscribed filter topic") messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node5) logger.debug(f"Response for node 5 is {len(messages_response)}") - assert len(messages_response) == 3, "Received messages != published !!" + assert len(messages_response) == messages_num, f"Received messages != published which is{messages_num} !!" From 810cd6cb4d51c502505bb69219e6571302a912ac Mon Sep 17 00:00:00 2001 From: aya Date: Thu, 31 Oct 2024 16:13:53 +0300 Subject: [PATCH 04/23] add test test_filter_50_subscribe_node --- src/node/waku_node.py | 2 +- tests/e2e/test_e2e.py | 43 +++++++++++++++++++++++++++++++++++++++---- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/node/waku_node.py b/src/node/waku_node.py index 6db2033115..c69c130e9e 100644 --- a/src/node/waku_node.py +++ b/src/node/waku_node.py @@ -123,7 +123,7 @@ def start(self, wait_for_node_sec=20, **kwargs): go_waku_args = { "min-relay-peers-to-publish": "1", "log-level": "DEBUG", - "rest-filter-cache-capacity": "50", + "rest-filter-cache-capacity": "60", "peer-store-capacity": "10", } default_args.update(go_waku_args) diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index 6e963788f0..1ccae97dc5 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -254,12 +254,12 @@ def test_filter_3_senders_45_msg_1_receiver(self): messages_num = 45 self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") self.node5 = WakuNode(NODE_2, f"node3_{self.test_id}") - + node_list = [] logger.debug("Start 5 nodes") self.node1.start(relay="true", store="true") - self.node2.start(relay="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) - self.node3.start(relay="true", store="true", filter="true", discv5_bootstrap_node=self.node2.get_enr_uri()) - self.node4.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node3.get_enr_uri()) + # self.node2.start(relay="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) + # self.node3.start(relay="true", store="true", filter="true", discv5_bootstrap_node=self.node2.get_enr_uri()) + self.node4.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) self.node5.start( relay="false", filter="true", filternode=self.node4.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node3.get_enr_uri() ) @@ -284,3 +284,38 @@ def test_filter_3_senders_45_msg_1_receiver(self): messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node5) logger.debug(f"Response for node 5 is {len(messages_response)}") assert len(messages_response) == messages_num, f"Received messages != published which is{messages_num} !!" + + @pytest.mark.timeout(60 * 15) + def test_filter_50_subscribe_node(self): + self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") + # self.node5 = WakuNode(NODE_2, f"node3_{self.test_id}") + node_list = [] + logger.debug("Start 5 nodes") + self.node1.start(relay="true", store="true") + # self.node2.start(relay="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) + # self.node3.start(relay="true", store="true", filter="true", discv5_bootstrap_node=self.node2.get_enr_uri()) + self.node4.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) + # self.node5.start( + # relay="false", filter="true", filternode=self.node4.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node3.get_enr_uri() + # ) + + logger.debug(f"Subscribe nodes to relay pubsub topic {self.test_pubsub_topic}") + node_list_relay = [self.node1, self.node4] + for node in node_list_relay: + node.set_relay_subscriptions([self.test_pubsub_topic]) + self.wait_for_autoconnection(node_list_relay, hard_wait=30) + + for i in range(50): + node_list.append(WakuNode(NODE_2, f"node{i}_{self.test_id}")) + delay(0.1) + node_list[i].start(relay="false", filter="true", filternode=self.node4.get_multiaddr_with_id(), store="false") + delay(2) + # node_list[i].set_filter_subscriptions( + # {"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic} + # ) + delay(2) + logger.debug(f"{i}$$$") + + logger.debug("Node5 requests messages of subscribed filter topic") + messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=node_list[0]) + logger.debug(f"Response for node 5 is {len(messages_response)}") From 39b8a2bd04366de31cb0a1adaea1674b0d420456 Mon Sep 17 00:00:00 2001 From: aya Date: Sun, 3 Nov 2024 13:38:50 +0200 Subject: [PATCH 05/23] Remove comments and enhance tests --- src/node/waku_node.py | 2 +- tests/e2e/test_e2e.py | 58 ++++++++----------------------------------- 2 files changed, 12 insertions(+), 48 deletions(-) diff --git a/src/node/waku_node.py b/src/node/waku_node.py index c69c130e9e..6db2033115 100644 --- a/src/node/waku_node.py +++ b/src/node/waku_node.py @@ -123,7 +123,7 @@ def start(self, wait_for_node_sec=20, **kwargs): go_waku_args = { "min-relay-peers-to-publish": "1", "log-level": "DEBUG", - "rest-filter-cache-capacity": "60", + "rest-filter-cache-capacity": "50", "peer-store-capacity": "10", } default_args.update(go_waku_args) diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index 1ccae97dc5..3638ec0c7f 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -178,40 +178,6 @@ def test_chain_of_relay_nodes(self): # self.node1 relays and we check that self.node10 receives the message self.check_published_message_reaches_relay_peer(sender=self.node1, peer_list=[self.node10], message_propagation_delay=1) - def test_filter_3_senders_3_msg_1_receiver(self): - messages_num = 3 - self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") - self.node5 = WakuNode(NODE_2, f"node3_{self.test_id}") - - logger.debug("Start 5 nodes") - self.node1.start(relay="true", store="true") - self.node2.start(relay="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) - self.node3.start(relay="true", store="true", filter="true", discv5_bootstrap_node=self.node2.get_enr_uri()) - self.node4.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node3.get_enr_uri()) - self.node5.start( - relay="false", filter="true", filternode=self.node4.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node3.get_enr_uri() - ) - - logger.debug(f"Subscribe nodes to relay pubsub topic {self.test_pubsub_topic}") - node_list = [self.node1, self.node2, self.node3, self.node4] - for node in node_list: - node.set_relay_subscriptions([self.test_pubsub_topic]) - self.wait_for_autoconnection(node_list, hard_wait=30) - - logger.debug(f"Node5 make filter request pubtopic {self.test_pubsub_topic} " f"{self.test_content_topic}and content topic ") - self.node5.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) - delay(1) - - logger.debug("3 Nodes publish 3 messages") - for node in node_list[:-1]: - self.publish_message(sender=node, pubsub_topic=self.test_pubsub_topic, message=self.create_message()) - delay(1) - - logger.debug("Node5 requests messages of subscribed filter topic") - messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node5) - logger.debug(f"Response for node 5 is {len(messages_response)}") - assert len(messages_response) == messages_num, f"Received messages != published which is{messages_num} !!" - def test_filter_3_senders_1_receiver(self): messages_num = 3 self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") @@ -257,8 +223,8 @@ def test_filter_3_senders_45_msg_1_receiver(self): node_list = [] logger.debug("Start 5 nodes") self.node1.start(relay="true", store="true") - # self.node2.start(relay="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) - # self.node3.start(relay="true", store="true", filter="true", discv5_bootstrap_node=self.node2.get_enr_uri()) + self.node2.start(relay="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) + self.node3.start(relay="true", store="true", filter="true", discv5_bootstrap_node=self.node2.get_enr_uri()) self.node4.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) self.node5.start( relay="false", filter="true", filternode=self.node4.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node3.get_enr_uri() @@ -292,15 +258,13 @@ def test_filter_50_subscribe_node(self): node_list = [] logger.debug("Start 5 nodes") self.node1.start(relay="true", store="true") - # self.node2.start(relay="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) - # self.node3.start(relay="true", store="true", filter="true", discv5_bootstrap_node=self.node2.get_enr_uri()) - self.node4.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) - # self.node5.start( - # relay="false", filter="true", filternode=self.node4.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node3.get_enr_uri() - # ) + self.node2.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) + self.node3.start( + relay="false", filter="true", filternode=self.node2.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node2.get_enr_uri() + ) logger.debug(f"Subscribe nodes to relay pubsub topic {self.test_pubsub_topic}") - node_list_relay = [self.node1, self.node4] + node_list_relay = [self.node1, self.node2] for node in node_list_relay: node.set_relay_subscriptions([self.test_pubsub_topic]) self.wait_for_autoconnection(node_list_relay, hard_wait=30) @@ -308,11 +272,11 @@ def test_filter_50_subscribe_node(self): for i in range(50): node_list.append(WakuNode(NODE_2, f"node{i}_{self.test_id}")) delay(0.1) - node_list[i].start(relay="false", filter="true", filternode=self.node4.get_multiaddr_with_id(), store="false") + node_list[i].start(relay="false", filter="true", filternode=self.node2.get_multiaddr_with_id(), store="false") delay(2) - # node_list[i].set_filter_subscriptions( - # {"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic} - # ) + node_list[i].set_filter_subscriptions( + {"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic} + ) delay(2) logger.debug(f"{i}$$$") From e9386bf562c675623f287b2a948ef593541c75a0 Mon Sep 17 00:00:00 2001 From: aya Date: Mon, 4 Nov 2024 15:44:51 +0200 Subject: [PATCH 06/23] Increase node limit to 1000 connection --- src/node/waku_node.py | 1 + tests/e2e/test_e2e.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/node/waku_node.py b/src/node/waku_node.py index 6db2033115..6ba6d184c4 100644 --- a/src/node/waku_node.py +++ b/src/node/waku_node.py @@ -117,6 +117,7 @@ def start(self, wait_for_node_sec=20, **kwargs): "rln-creds-id": None, "rln-creds-source": None, "nodekey": self.generate_random_nodekey(), + "max-connections": "1000", } if self.is_gowaku(): diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index 3638ec0c7f..e3fb2ce940 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -198,7 +198,7 @@ def test_filter_3_senders_1_receiver(self): node.set_relay_subscriptions([self.test_pubsub_topic]) self.wait_for_autoconnection(node_list, hard_wait=30) - logger.debug(f"Node5 make filter request pubtopic {self.test_pubsub_topic} " f"{self.test_content_topic}and content topic ") + logger.debug(f"Node5 make filter request pubtopic {self.test_pubsub_topic} and content topic {self.test_content_topic}") self.node5.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) delay(1) @@ -269,17 +269,19 @@ def test_filter_50_subscribe_node(self): node.set_relay_subscriptions([self.test_pubsub_topic]) self.wait_for_autoconnection(node_list_relay, hard_wait=30) - for i in range(50): + for i in range(996): node_list.append(WakuNode(NODE_2, f"node{i}_{self.test_id}")) delay(0.1) node_list[i].start(relay="false", filter="true", filternode=self.node2.get_multiaddr_with_id(), store="false") - delay(2) + delay(5) node_list[i].set_filter_subscriptions( {"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic} ) delay(2) logger.debug(f"{i}$$$") + self.publish_message(sender=node, pubsub_topic=self.test_pubsub_topic, message=self.create_message()) + delay(3) logger.debug("Node5 requests messages of subscribed filter topic") messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=node_list[0]) logger.debug(f"Response for node 5 is {len(messages_response)}") From 88a3882150fa352d1b1c9e41e09c532855b45e8e Mon Sep 17 00:00:00 2001 From: aya Date: Wed, 6 Nov 2024 09:19:29 +0200 Subject: [PATCH 07/23] making PR ready with 3 tests --- src/env_vars.py | 1 + tests/e2e/test_e2e.py | 102 +++++++++++++++++++++++------------------- 2 files changed, 56 insertions(+), 47 deletions(-) diff --git a/src/env_vars.py b/src/env_vars.py index 51b0c4d43f..bdd008f075 100644 --- a/src/env_vars.py +++ b/src/env_vars.py @@ -16,6 +16,7 @@ def get_env_var(var_name, default=None): # Configuration constants. Need to be upercase to appear in reports DEFAULT_NWAKU = "wakuorg/nwaku:latest" DEFAULT_GOWAKU = "wakuorg/go-waku:latest" +STRESS_ENABLED = False NODE_1 = get_env_var("NODE_1", DEFAULT_NWAKU) NODE_2 = get_env_var("NODE_2", DEFAULT_NWAKU) ADDITIONAL_NODES = get_env_var("ADDITIONAL_NODES", f"{DEFAULT_NWAKU},{DEFAULT_GOWAKU},{DEFAULT_NWAKU}") diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index e3fb2ce940..061ad3f84b 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -1,5 +1,5 @@ import pytest -from src.env_vars import NODE_1, NODE_2 +from src.env_vars import NODE_1, NODE_2, STRESS_ENABLED from src.libs.common import delay from src.libs.custom_logger import get_custom_logger from src.node.waku_node import WakuNode @@ -178,49 +178,55 @@ def test_chain_of_relay_nodes(self): # self.node1 relays and we check that self.node10 receives the message self.check_published_message_reaches_relay_peer(sender=self.node1, peer_list=[self.node10], message_propagation_delay=1) - def test_filter_3_senders_1_receiver(self): - messages_num = 3 - self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") - self.node5 = WakuNode(NODE_2, f"node3_{self.test_id}") + @pytest.mark.timeout(60 * 5) + def test_filter_30_senders_1_receiver(self): + total_senders = 30 + node_list = [] - logger.debug("Start 5 nodes") - self.node1.start(relay="true", store="true") - self.node2.start(relay="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) - self.node3.start(relay="true", store="true", filter="true", discv5_bootstrap_node=self.node2.get_enr_uri()) - self.node4.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node3.get_enr_uri()) - self.node5.start( - relay="false", filter="true", filternode=self.node4.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node3.get_enr_uri() - ) + logger.debug(f"Start {total_senders} nodes to publish messages ") + self.node1.start(relay="true") + node_list.append(self.node1) + for i in range(total_senders - 1): + node_list.append(WakuNode(NODE_1, f"node{i + 1}_{self.test_id}")) + delay(0.1) + node_list[i + 1].start(relay="true", discv5_bootstrap_node=node_list[i].get_enr_uri()) + delay(2) + + logger.debug(f"Start filter node and subscribed filter node ") + self.node31 = WakuNode(NODE_2, f"node31_{self.test_id}") + self.node32 = WakuNode(NODE_2, f"node32_{self.test_id}") + self.node31.start(relay="true", filter="true", store="false", discv5_bootstrap_node=node_list[total_senders - 1].get_enr_uri()) + self.node32.start(relay="false", filter="true", filternode=self.node31.get_multiaddr_with_id(), store="false") + + node_list.append(self.node31) logger.debug(f"Subscribe nodes to relay pubsub topic {self.test_pubsub_topic}") - node_list = [self.node1, self.node2, self.node3, self.node4] for node in node_list: node.set_relay_subscriptions([self.test_pubsub_topic]) - self.wait_for_autoconnection(node_list, hard_wait=30) + self.wait_for_autoconnection(node_list, hard_wait=50) - logger.debug(f"Node5 make filter request pubtopic {self.test_pubsub_topic} and content topic {self.test_content_topic}") - self.node5.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) + logger.debug(f"Node32 make filter request to pubsubtopic {self.test_pubsub_topic} and content topic {self.test_content_topic}") + self.node32.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) delay(1) - logger.debug("3 Nodes publish 3 messages") + logger.debug(f"{total_senders} Nodes publish {total_senders} messages") for node in node_list[:-1]: self.publish_message(sender=node, pubsub_topic=self.test_pubsub_topic, message=self.create_message()) delay(1) - delay(250) - logger.debug("Node5 requests messages of subscribed filter topic") - messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node5) + logger.debug("Node 32 requests messages of subscribed filter topic") + messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node32) - delay(250) - messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node5) - logger.debug(f"Response for node 5 is {len(messages_response)}") - assert len(messages_response) == messages_num, f"Received messages != published which is{messages_num} !!" + logger.debug(f"Total number received messages for node 32 is {len(messages_response)}") + assert len(messages_response) == total_senders, f"Received messages != published which is {total_senders} !!" def test_filter_3_senders_45_msg_1_receiver(self): messages_num = 45 + total_senders = 3 self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") self.node5 = WakuNode(NODE_2, f"node3_{self.test_id}") node_list = [] + logger.debug("Start 5 nodes") self.node1.start(relay="true", store="true") self.node2.start(relay="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) @@ -236,32 +242,30 @@ def test_filter_3_senders_45_msg_1_receiver(self): node.set_relay_subscriptions([self.test_pubsub_topic]) self.wait_for_autoconnection(node_list, hard_wait=30) - logger.debug(f"Node5 make filter request pubtopic {self.test_pubsub_topic} " f"{self.test_content_topic}and content topic ") + logger.debug(f"Node5 makes filter request pubsubtopic {self.test_pubsub_topic} and content topic {self.test_content_topic}") self.node5.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) delay(1) - logger.debug("3 Nodes publish 45 message") + logger.debug(f" {total_senders} Nodes publish {messages_num} message") for node in node_list[:-1]: - for i in range(15): + for i in range(messages_num // total_senders): self.publish_message(sender=node, pubsub_topic=self.test_pubsub_topic, message=self.create_message()) delay(0.2) - logger.debug("Node5 requests messages of subscribed filter topic") + logger.debug(f"Node5 requests messages of subscribed filter topic {self.test_pubsub_topic}") messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node5) - logger.debug(f"Response for node 5 is {len(messages_response)}") + logger.debug(f"Response for node 5 is {messages_response}") assert len(messages_response) == messages_num, f"Received messages != published which is{messages_num} !!" - @pytest.mark.timeout(60 * 15) - def test_filter_50_subscribe_node(self): - self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") - # self.node5 = WakuNode(NODE_2, f"node3_{self.test_id}") + @pytest.mark.timeout(60 * 3) + def test_filter_many_subscribed_nodes(self): + max_subscribed_nodes = 30 + if STRESS_ENABLED: + max_subscribed_nodes = 500 node_list = [] - logger.debug("Start 5 nodes") + logger.debug("Start 2 nodes") self.node1.start(relay="true", store="true") self.node2.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) - self.node3.start( - relay="false", filter="true", filternode=self.node2.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node2.get_enr_uri() - ) logger.debug(f"Subscribe nodes to relay pubsub topic {self.test_pubsub_topic}") node_list_relay = [self.node1, self.node2] @@ -269,19 +273,23 @@ def test_filter_50_subscribe_node(self): node.set_relay_subscriptions([self.test_pubsub_topic]) self.wait_for_autoconnection(node_list_relay, hard_wait=30) - for i in range(996): + logger.debug(f"{max_subscribed_nodes} Node start and making filter requests to node2") + for i in range(max_subscribed_nodes): node_list.append(WakuNode(NODE_2, f"node{i}_{self.test_id}")) delay(0.1) node_list[i].start(relay="false", filter="true", filternode=self.node2.get_multiaddr_with_id(), store="false") - delay(5) + delay(1) node_list[i].set_filter_subscriptions( {"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic} ) - delay(2) - logger.debug(f"{i}$$$") + delay(1) + + logger.debug("Node1 publish message") + self.publish_message(sender=self.node1, pubsub_topic=self.test_pubsub_topic, message=self.create_message()) + delay(2) - self.publish_message(sender=node, pubsub_topic=self.test_pubsub_topic, message=self.create_message()) - delay(3) - logger.debug("Node5 requests messages of subscribed filter topic") - messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=node_list[0]) - logger.debug(f"Response for node 5 is {len(messages_response)}") + logger.debug(f"{max_subscribed_nodes} Node requests the published message of subscribed filter topic") + for i in range(max_subscribed_nodes): + messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=node_list[i]) + logger.debug(f"Response for node {i} is {messages_response}") + assert len(messages_response) == 1, "Received message count doesn't match sent " From 64a231500827bae61d09e44e1e34f47bb098b0b7 Mon Sep 17 00:00:00 2001 From: aya Date: Wed, 6 Nov 2024 10:41:19 +0200 Subject: [PATCH 08/23] Making changes for go-waku to pass --- tests/e2e/test_e2e.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index 061ad3f84b..922442cb71 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -178,7 +178,7 @@ def test_chain_of_relay_nodes(self): # self.node1 relays and we check that self.node10 receives the message self.check_published_message_reaches_relay_peer(sender=self.node1, peer_list=[self.node10], message_propagation_delay=1) - @pytest.mark.timeout(60 * 5) + @pytest.mark.timeout(60 * 7) def test_filter_30_senders_1_receiver(self): total_senders = 30 node_list = [] @@ -187,14 +187,14 @@ def test_filter_30_senders_1_receiver(self): self.node1.start(relay="true") node_list.append(self.node1) for i in range(total_senders - 1): - node_list.append(WakuNode(NODE_1, f"node{i + 1}_{self.test_id}")) + node_list.append(WakuNode(NODE_2, f"node{i + 1}_{self.test_id}")) delay(0.1) node_list[i + 1].start(relay="true", discv5_bootstrap_node=node_list[i].get_enr_uri()) delay(2) logger.debug(f"Start filter node and subscribed filter node ") - self.node31 = WakuNode(NODE_2, f"node31_{self.test_id}") - self.node32 = WakuNode(NODE_2, f"node32_{self.test_id}") + self.node31 = WakuNode(NODE_1, f"node31_{self.test_id}") + self.node32 = WakuNode(NODE_1, f"node32_{self.test_id}") self.node31.start(relay="true", filter="true", store="false", discv5_bootstrap_node=node_list[total_senders - 1].get_enr_uri()) self.node32.start(relay="false", filter="true", filternode=self.node31.get_multiaddr_with_id(), store="false") From 048e6175790672276d751bab4c21afb7ae112daf Mon Sep 17 00:00:00 2001 From: aya Date: Wed, 6 Nov 2024 14:18:03 +0200 Subject: [PATCH 09/23] Adding changes to make go-waku tests pass --- src/env_vars.py | 2 +- tests/e2e/test_e2e.py | 29 ++++++++++++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/env_vars.py b/src/env_vars.py index bdd008f075..fe4bddcf76 100644 --- a/src/env_vars.py +++ b/src/env_vars.py @@ -27,7 +27,7 @@ def get_env_var(var_name, default=None): IP_RANGE = get_env_var("IP_RANGE", "172.18.0.0/24") GATEWAY = get_env_var("GATEWAY", "172.18.0.1") RUNNING_IN_CI = get_env_var("CI") -API_REQUEST_TIMEOUT = get_env_var("API_REQUEST_TIMEOUT", 20) +API_REQUEST_TIMEOUT = get_env_var("API_REQUEST_TIMEOUT", 50) RLN_CREDENTIALS = get_env_var("RLN_CREDENTIALS") PG_USER = get_env_var("POSTGRES_USER", "postgres") PG_PASS = get_env_var("POSTGRES_PASSWORD", "test123") diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index 922442cb71..0fbba22a8d 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -179,8 +179,9 @@ def test_chain_of_relay_nodes(self): self.check_published_message_reaches_relay_peer(sender=self.node1, peer_list=[self.node10], message_propagation_delay=1) @pytest.mark.timeout(60 * 7) + # @pytest.mark.skipif("go-waku" in (NODE_1 + NODE_2), reason="Test works only with nwaku") def test_filter_30_senders_1_receiver(self): - total_senders = 30 + total_senders = 25 node_list = [] logger.debug(f"Start {total_senders} nodes to publish messages ") @@ -196,7 +197,9 @@ def test_filter_30_senders_1_receiver(self): self.node31 = WakuNode(NODE_1, f"node31_{self.test_id}") self.node32 = WakuNode(NODE_1, f"node32_{self.test_id}") self.node31.start(relay="true", filter="true", store="false", discv5_bootstrap_node=node_list[total_senders - 1].get_enr_uri()) - self.node32.start(relay="false", filter="true", filternode=self.node31.get_multiaddr_with_id(), store="false") + self.node32.start( + relay="false", filter="true", filternode=self.node31.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node31 + ) node_list.append(self.node31) @@ -258,8 +261,9 @@ def test_filter_3_senders_45_msg_1_receiver(self): assert len(messages_response) == messages_num, f"Received messages != published which is{messages_num} !!" @pytest.mark.timeout(60 * 3) + # @pytest.mark.skipif("go-waku" in (NODE_1 + NODE_2), reason="Test works only with nwaku") def test_filter_many_subscribed_nodes(self): - max_subscribed_nodes = 30 + max_subscribed_nodes = 25 if STRESS_ENABLED: max_subscribed_nodes = 500 node_list = [] @@ -273,13 +277,20 @@ def test_filter_many_subscribed_nodes(self): node.set_relay_subscriptions([self.test_pubsub_topic]) self.wait_for_autoconnection(node_list_relay, hard_wait=30) + node_list.append(self.node2) logger.debug(f"{max_subscribed_nodes} Node start and making filter requests to node2") - for i in range(max_subscribed_nodes): + for i in range(max_subscribed_nodes + 1): node_list.append(WakuNode(NODE_2, f"node{i}_{self.test_id}")) delay(0.1) - node_list[i].start(relay="false", filter="true", filternode=self.node2.get_multiaddr_with_id(), store="false") + node_list[i + 1].start( + relay="false", + filter="true", + filternode=self.node2.get_multiaddr_with_id(), + discv5_bootstrap_node=node_list[i].get_enr_uri(), + store="false", + ) delay(1) - node_list[i].set_filter_subscriptions( + node_list[i + 1].set_filter_subscriptions( {"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic} ) delay(1) @@ -289,7 +300,7 @@ def test_filter_many_subscribed_nodes(self): delay(2) logger.debug(f"{max_subscribed_nodes} Node requests the published message of subscribed filter topic") - for i in range(max_subscribed_nodes): - messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=node_list[i]) - logger.debug(f"Response for node {i} is {messages_response}") + for i in range(max_subscribed_nodes + 1): + messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=node_list[i + 1]) + logger.debug(f"Response for node {i+1} is {messages_response}") assert len(messages_response) == 1, "Received message count doesn't match sent " From fe2bd97fe9e56b0a14d90568c9ce8e85cb5938e7 Mon Sep 17 00:00:00 2001 From: aya Date: Wed, 6 Nov 2024 15:07:06 +0200 Subject: [PATCH 10/23] Change max nodes to 20 when node_2 = go-waku --- tests/e2e/test_e2e.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index 0fbba22a8d..a398b1a87a 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -181,7 +181,9 @@ def test_chain_of_relay_nodes(self): @pytest.mark.timeout(60 * 7) # @pytest.mark.skipif("go-waku" in (NODE_1 + NODE_2), reason="Test works only with nwaku") def test_filter_30_senders_1_receiver(self): - total_senders = 25 + total_senders = 30 + if "go-waku" in NODE_2: + total_senders = 20 node_list = [] logger.debug(f"Start {total_senders} nodes to publish messages ") @@ -263,7 +265,9 @@ def test_filter_3_senders_45_msg_1_receiver(self): @pytest.mark.timeout(60 * 3) # @pytest.mark.skipif("go-waku" in (NODE_1 + NODE_2), reason="Test works only with nwaku") def test_filter_many_subscribed_nodes(self): - max_subscribed_nodes = 25 + max_subscribed_nodes = 30 + if "go-waku" in NODE_2: + max_subscribed_nodes = 20 if STRESS_ENABLED: max_subscribed_nodes = 500 node_list = [] From e50150ae2ee38a2926ab5eebb08df1fc348a3b37 Mon Sep 17 00:00:00 2001 From: aya Date: Wed, 6 Nov 2024 22:24:33 +0200 Subject: [PATCH 11/23] Fix CI failure because of nwaku --- tests/e2e/test_e2e.py | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index a398b1a87a..4c4c80045e 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -179,11 +179,8 @@ def test_chain_of_relay_nodes(self): self.check_published_message_reaches_relay_peer(sender=self.node1, peer_list=[self.node10], message_propagation_delay=1) @pytest.mark.timeout(60 * 7) - # @pytest.mark.skipif("go-waku" in (NODE_1 + NODE_2), reason="Test works only with nwaku") def test_filter_30_senders_1_receiver(self): - total_senders = 30 - if "go-waku" in NODE_2: - total_senders = 20 + total_senders = 20 node_list = [] logger.debug(f"Start {total_senders} nodes to publish messages ") @@ -196,14 +193,14 @@ def test_filter_30_senders_1_receiver(self): delay(2) logger.debug(f"Start filter node and subscribed filter node ") - self.node31 = WakuNode(NODE_1, f"node31_{self.test_id}") - self.node32 = WakuNode(NODE_1, f"node32_{self.test_id}") - self.node31.start(relay="true", filter="true", store="false", discv5_bootstrap_node=node_list[total_senders - 1].get_enr_uri()) - self.node32.start( - relay="false", filter="true", filternode=self.node31.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node31 + self.node21 = WakuNode(NODE_1, f"node31_{self.test_id}") + self.node22 = WakuNode(NODE_1, f"node32_{self.test_id}") + self.node21.start(relay="true", filter="true", store="false", discv5_bootstrap_node=node_list[total_senders - 1].get_enr_uri()) + self.node22.start( + relay="false", filter="true", filternode=self.node21.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node21 ) - node_list.append(self.node31) + node_list.append(self.node21) logger.debug(f"Subscribe nodes to relay pubsub topic {self.test_pubsub_topic}") for node in node_list: @@ -211,7 +208,7 @@ def test_filter_30_senders_1_receiver(self): self.wait_for_autoconnection(node_list, hard_wait=50) logger.debug(f"Node32 make filter request to pubsubtopic {self.test_pubsub_topic} and content topic {self.test_content_topic}") - self.node32.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) + self.node22.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) delay(1) logger.debug(f"{total_senders} Nodes publish {total_senders} messages") @@ -220,9 +217,9 @@ def test_filter_30_senders_1_receiver(self): delay(1) logger.debug("Node 32 requests messages of subscribed filter topic") - messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node32) + messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node22) - logger.debug(f"Total number received messages for node 32 is {len(messages_response)}") + logger.debug(f"Total number received messages for node 22 is {len(messages_response)}") assert len(messages_response) == total_senders, f"Received messages != published which is {total_senders} !!" def test_filter_3_senders_45_msg_1_receiver(self): @@ -262,14 +259,11 @@ def test_filter_3_senders_45_msg_1_receiver(self): logger.debug(f"Response for node 5 is {messages_response}") assert len(messages_response) == messages_num, f"Received messages != published which is{messages_num} !!" - @pytest.mark.timeout(60 * 3) - # @pytest.mark.skipif("go-waku" in (NODE_1 + NODE_2), reason="Test works only with nwaku") + @pytest.mark.timeout(60 * 5) def test_filter_many_subscribed_nodes(self): - max_subscribed_nodes = 30 - if "go-waku" in NODE_2: - max_subscribed_nodes = 20 + max_subscribed_nodes = 20 if STRESS_ENABLED: - max_subscribed_nodes = 500 + max_subscribed_nodes = 50 node_list = [] logger.debug("Start 2 nodes") self.node1.start(relay="true", store="true") @@ -283,7 +277,7 @@ def test_filter_many_subscribed_nodes(self): node_list.append(self.node2) logger.debug(f"{max_subscribed_nodes} Node start and making filter requests to node2") - for i in range(max_subscribed_nodes + 1): + for i in range(max_subscribed_nodes): node_list.append(WakuNode(NODE_2, f"node{i}_{self.test_id}")) delay(0.1) node_list[i + 1].start( @@ -304,7 +298,7 @@ def test_filter_many_subscribed_nodes(self): delay(2) logger.debug(f"{max_subscribed_nodes} Node requests the published message of subscribed filter topic") - for i in range(max_subscribed_nodes + 1): + for i in range(max_subscribed_nodes): messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=node_list[i + 1]) logger.debug(f"Response for node {i+1} is {messages_response}") assert len(messages_response) == 1, "Received message count doesn't match sent " From 9ae09a30132e124a8fe95dbaca9bdfc633bfb96f Mon Sep 17 00:00:00 2001 From: aya Date: Thu, 7 Nov 2024 00:42:03 +0200 Subject: [PATCH 12/23] Increase wait time for filter request --- tests/e2e/test_e2e.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index 4c4c80045e..3c5dc279e9 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -205,18 +205,16 @@ def test_filter_30_senders_1_receiver(self): logger.debug(f"Subscribe nodes to relay pubsub topic {self.test_pubsub_topic}") for node in node_list: node.set_relay_subscriptions([self.test_pubsub_topic]) - self.wait_for_autoconnection(node_list, hard_wait=50) - - logger.debug(f"Node32 make filter request to pubsubtopic {self.test_pubsub_topic} and content topic {self.test_content_topic}") + logger.debug(f"Node22 make filter request to pubsubtopic {self.test_pubsub_topic} and content topic {self.test_content_topic}") self.node22.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) - delay(1) + self.wait_for_autoconnection(node_list, hard_wait=50) logger.debug(f"{total_senders} Nodes publish {total_senders} messages") for node in node_list[:-1]: self.publish_message(sender=node, pubsub_topic=self.test_pubsub_topic, message=self.create_message()) delay(1) - logger.debug("Node 32 requests messages of subscribed filter topic") + logger.debug("Node 22 requests messages of subscribed filter topic") messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node22) logger.debug(f"Total number received messages for node 22 is {len(messages_response)}") @@ -242,11 +240,9 @@ def test_filter_3_senders_45_msg_1_receiver(self): node_list = [self.node1, self.node2, self.node3, self.node4] for node in node_list: node.set_relay_subscriptions([self.test_pubsub_topic]) - self.wait_for_autoconnection(node_list, hard_wait=30) - logger.debug(f"Node5 makes filter request pubsubtopic {self.test_pubsub_topic} and content topic {self.test_content_topic}") self.node5.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) - delay(1) + self.wait_for_autoconnection(node_list, hard_wait=30) logger.debug(f" {total_senders} Nodes publish {messages_num} message") for node in node_list[:-1]: @@ -291,7 +287,7 @@ def test_filter_many_subscribed_nodes(self): node_list[i + 1].set_filter_subscriptions( {"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic} ) - delay(1) + delay(30) logger.debug("Node1 publish message") self.publish_message(sender=self.node1, pubsub_topic=self.test_pubsub_topic, message=self.create_message()) From 254c160f42b442ade3c10cf902685f54fd52bdbd Mon Sep 17 00:00:00 2001 From: aya Date: Thu, 7 Nov 2024 01:11:19 +0200 Subject: [PATCH 13/23] Decrease number of nodes to pass the CI --- tests/e2e/test_e2e.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index 3c5dc279e9..7cae886c00 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -221,7 +221,7 @@ def test_filter_30_senders_1_receiver(self): assert len(messages_response) == total_senders, f"Received messages != published which is {total_senders} !!" def test_filter_3_senders_45_msg_1_receiver(self): - messages_num = 45 + messages_num = 12 total_senders = 3 self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") self.node5 = WakuNode(NODE_2, f"node3_{self.test_id}") @@ -257,7 +257,7 @@ def test_filter_3_senders_45_msg_1_receiver(self): @pytest.mark.timeout(60 * 5) def test_filter_many_subscribed_nodes(self): - max_subscribed_nodes = 20 + max_subscribed_nodes = 5 if STRESS_ENABLED: max_subscribed_nodes = 50 node_list = [] From a002fa5873419a664a159f19598e678e5dd1a00b Mon Sep 17 00:00:00 2001 From: aya Date: Thu, 7 Nov 2024 01:35:39 +0200 Subject: [PATCH 14/23] Add more wait to pass CI --- tests/e2e/test_e2e.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index 7cae886c00..42ae1052af 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -242,13 +242,14 @@ def test_filter_3_senders_45_msg_1_receiver(self): node.set_relay_subscriptions([self.test_pubsub_topic]) logger.debug(f"Node5 makes filter request pubsubtopic {self.test_pubsub_topic} and content topic {self.test_content_topic}") self.node5.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) - self.wait_for_autoconnection(node_list, hard_wait=30) + node_list.append(self.node5) + self.wait_for_autoconnection(node_list, hard_wait=60) logger.debug(f" {total_senders} Nodes publish {messages_num} message") - for node in node_list[:-1]: + for node in node_list[:-2]: for i in range(messages_num // total_senders): self.publish_message(sender=node, pubsub_topic=self.test_pubsub_topic, message=self.create_message()) - delay(0.2) + delay(2) logger.debug(f"Node5 requests messages of subscribed filter topic {self.test_pubsub_topic}") messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=self.node5) @@ -269,7 +270,6 @@ def test_filter_many_subscribed_nodes(self): node_list_relay = [self.node1, self.node2] for node in node_list_relay: node.set_relay_subscriptions([self.test_pubsub_topic]) - self.wait_for_autoconnection(node_list_relay, hard_wait=30) node_list.append(self.node2) logger.debug(f"{max_subscribed_nodes} Node start and making filter requests to node2") @@ -287,7 +287,7 @@ def test_filter_many_subscribed_nodes(self): node_list[i + 1].set_filter_subscriptions( {"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic} ) - delay(30) + self.wait_for_autoconnection(node_list_relay, hard_wait=100) logger.debug("Node1 publish message") self.publish_message(sender=self.node1, pubsub_topic=self.test_pubsub_topic, message=self.create_message()) From 9c045a72cd5384ead09d2e7ca437400aae4645e2 Mon Sep 17 00:00:00 2001 From: aya Date: Thu, 7 Nov 2024 01:50:09 +0200 Subject: [PATCH 15/23] time_limit increase to 120 to pass CI --- tests/e2e/test_e2e.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index 42ae1052af..ceb45a2258 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -220,7 +220,7 @@ def test_filter_30_senders_1_receiver(self): logger.debug(f"Total number received messages for node 22 is {len(messages_response)}") assert len(messages_response) == total_senders, f"Received messages != published which is {total_senders} !!" - def test_filter_3_senders_45_msg_1_receiver(self): + def test_filter_3_senders_multiple_msg_1_receiver(self): messages_num = 12 total_senders = 3 self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") @@ -243,7 +243,7 @@ def test_filter_3_senders_45_msg_1_receiver(self): logger.debug(f"Node5 makes filter request pubsubtopic {self.test_pubsub_topic} and content topic {self.test_content_topic}") self.node5.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) node_list.append(self.node5) - self.wait_for_autoconnection(node_list, hard_wait=60) + self.wait_for_autoconnection(node_list, hard_wait=120) logger.debug(f" {total_senders} Nodes publish {messages_num} message") for node in node_list[:-2]: From 3c33fc2aca18008299a932a1ad144ed5dcffc7f5 Mon Sep 17 00:00:00 2001 From: aya Date: Thu, 7 Nov 2024 06:39:29 +0200 Subject: [PATCH 16/23] add flag filter-subscription-timeout to 600 instead of default value 300 --- src/node/waku_node.py | 1 + tests/e2e/test_e2e.py | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/node/waku_node.py b/src/node/waku_node.py index 6ba6d184c4..7c44e1bfbf 100644 --- a/src/node/waku_node.py +++ b/src/node/waku_node.py @@ -118,6 +118,7 @@ def start(self, wait_for_node_sec=20, **kwargs): "rln-creds-source": None, "nodekey": self.generate_random_nodekey(), "max-connections": "1000", + "filter-subscription-timeout": "600", } if self.is_gowaku(): diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index ceb45a2258..e1c4fa71e8 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -179,7 +179,7 @@ def test_chain_of_relay_nodes(self): self.check_published_message_reaches_relay_peer(sender=self.node1, peer_list=[self.node10], message_propagation_delay=1) @pytest.mark.timeout(60 * 7) - def test_filter_30_senders_1_receiver(self): + def test_filter_20_senders_1_receiver(self): total_senders = 20 node_list = [] @@ -220,17 +220,18 @@ def test_filter_30_senders_1_receiver(self): logger.debug(f"Total number received messages for node 22 is {len(messages_response)}") assert len(messages_response) == total_senders, f"Received messages != published which is {total_senders} !!" + @pytest.mark.timeout(60 * 7) def test_filter_3_senders_multiple_msg_1_receiver(self): - messages_num = 12 + messages_num = 3 total_senders = 3 self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") self.node5 = WakuNode(NODE_2, f"node3_{self.test_id}") node_list = [] logger.debug("Start 5 nodes") - self.node1.start(relay="true", store="true") + self.node1.start(relay="true", store="false") self.node2.start(relay="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) - self.node3.start(relay="true", store="true", filter="true", discv5_bootstrap_node=self.node2.get_enr_uri()) + self.node3.start(relay="true", store="false", filter="true", discv5_bootstrap_node=self.node2.get_enr_uri()) self.node4.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) self.node5.start( relay="false", filter="true", filternode=self.node4.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node3.get_enr_uri() @@ -240,10 +241,11 @@ def test_filter_3_senders_multiple_msg_1_receiver(self): node_list = [self.node1, self.node2, self.node3, self.node4] for node in node_list: node.set_relay_subscriptions([self.test_pubsub_topic]) + logger.debug(f"Node5 makes filter request pubsubtopic {self.test_pubsub_topic} and content topic {self.test_content_topic}") self.node5.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) node_list.append(self.node5) - self.wait_for_autoconnection(node_list, hard_wait=120) + self.wait_for_autoconnection(node_list, hard_wait=60) logger.debug(f" {total_senders} Nodes publish {messages_num} message") for node in node_list[:-2]: @@ -258,12 +260,12 @@ def test_filter_3_senders_multiple_msg_1_receiver(self): @pytest.mark.timeout(60 * 5) def test_filter_many_subscribed_nodes(self): - max_subscribed_nodes = 5 + max_subscribed_nodes = 2 if STRESS_ENABLED: max_subscribed_nodes = 50 node_list = [] logger.debug("Start 2 nodes") - self.node1.start(relay="true", store="true") + self.node1.start(relay="true", store="false") self.node2.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) logger.debug(f"Subscribe nodes to relay pubsub topic {self.test_pubsub_topic}") From ccc672192668d0045548a34c268d854c57a2fef4 Mon Sep 17 00:00:00 2001 From: aya Date: Thu, 7 Nov 2024 07:36:31 +0200 Subject: [PATCH 17/23] Additional changes for CI failure --- tests/e2e/test_e2e.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index e1c4fa71e8..5a240f99d7 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -193,8 +193,8 @@ def test_filter_20_senders_1_receiver(self): delay(2) logger.debug(f"Start filter node and subscribed filter node ") - self.node21 = WakuNode(NODE_1, f"node31_{self.test_id}") - self.node22 = WakuNode(NODE_1, f"node32_{self.test_id}") + self.node21 = WakuNode(NODE_1, f"node21_{self.test_id}") + self.node22 = WakuNode(NODE_1, f"node22_{self.test_id}") self.node21.start(relay="true", filter="true", store="false", discv5_bootstrap_node=node_list[total_senders - 1].get_enr_uri()) self.node22.start( relay="false", filter="true", filternode=self.node21.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node21 @@ -224,15 +224,15 @@ def test_filter_20_senders_1_receiver(self): def test_filter_3_senders_multiple_msg_1_receiver(self): messages_num = 3 total_senders = 3 - self.node4 = WakuNode(NODE_2, f"node3_{self.test_id}") - self.node5 = WakuNode(NODE_2, f"node3_{self.test_id}") + self.node4 = WakuNode(NODE_1, f"node4_{self.test_id}") + self.node5 = WakuNode(NODE_1, f"node5_{self.test_id}") node_list = [] logger.debug("Start 5 nodes") self.node1.start(relay="true", store="false") self.node2.start(relay="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) self.node3.start(relay="true", store="false", filter="true", discv5_bootstrap_node=self.node2.get_enr_uri()) - self.node4.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) + self.node4.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node3.get_enr_uri()) self.node5.start( relay="false", filter="true", filternode=self.node4.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node3.get_enr_uri() ) @@ -264,6 +264,7 @@ def test_filter_many_subscribed_nodes(self): if STRESS_ENABLED: max_subscribed_nodes = 50 node_list = [] + response_list = [] logger.debug("Start 2 nodes") self.node1.start(relay="true", store="false") self.node2.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) @@ -276,7 +277,7 @@ def test_filter_many_subscribed_nodes(self): node_list.append(self.node2) logger.debug(f"{max_subscribed_nodes} Node start and making filter requests to node2") for i in range(max_subscribed_nodes): - node_list.append(WakuNode(NODE_2, f"node{i}_{self.test_id}")) + node_list.append(WakuNode(NODE_2, f"node{i+2}_{self.test_id}")) delay(0.1) node_list[i + 1].start( relay="false", @@ -293,10 +294,12 @@ def test_filter_many_subscribed_nodes(self): logger.debug("Node1 publish message") self.publish_message(sender=self.node1, pubsub_topic=self.test_pubsub_topic, message=self.create_message()) - delay(2) + delay(4) logger.debug(f"{max_subscribed_nodes} Node requests the published message of subscribed filter topic") for i in range(max_subscribed_nodes): messages_response = self.get_filter_messages(self.test_content_topic, pubsub_topic=self.test_pubsub_topic, node=node_list[i + 1]) logger.debug(f"Response for node {i+1} is {messages_response}") - assert len(messages_response) == 1, "Received message count doesn't match sent " + response_list.append(messages_response) + + assert len(response_list) == max_subscribed_nodes, "Received message count doesn't match sent " From 4afa5aa1c28938bc7952d5faa62c6347daad8b9e Mon Sep 17 00:00:00 2001 From: aya Date: Thu, 7 Nov 2024 07:50:15 +0200 Subject: [PATCH 18/23] remove filter = true from subscribed filter node --- tests/e2e/test_e2e.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index 5a240f99d7..3ed22c6871 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -233,9 +233,7 @@ def test_filter_3_senders_multiple_msg_1_receiver(self): self.node2.start(relay="true", store="false", discv5_bootstrap_node=self.node1.get_enr_uri()) self.node3.start(relay="true", store="false", filter="true", discv5_bootstrap_node=self.node2.get_enr_uri()) self.node4.start(relay="true", filter="true", store="false", discv5_bootstrap_node=self.node3.get_enr_uri()) - self.node5.start( - relay="false", filter="true", filternode=self.node4.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node3.get_enr_uri() - ) + self.node5.start(relay="false", filternode=self.node4.get_multiaddr_with_id(), store="false", discv5_bootstrap_node=self.node3.get_enr_uri()) logger.debug(f"Subscribe nodes to relay pubsub topic {self.test_pubsub_topic}") node_list = [self.node1, self.node2, self.node3, self.node4] @@ -281,7 +279,6 @@ def test_filter_many_subscribed_nodes(self): delay(0.1) node_list[i + 1].start( relay="false", - filter="true", filternode=self.node2.get_multiaddr_with_id(), discv5_bootstrap_node=node_list[i].get_enr_uri(), store="false", From d2348c8507656df3d9b5f94046dc6e1a888ddece Mon Sep 17 00:00:00 2001 From: aya Date: Thu, 7 Nov 2024 10:40:51 +0200 Subject: [PATCH 19/23] increase nodes to 15 in test_filter_many_subscribed_nodes --- tests/e2e/test_e2e.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index 3ed22c6871..bf242d0763 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -222,7 +222,7 @@ def test_filter_20_senders_1_receiver(self): @pytest.mark.timeout(60 * 7) def test_filter_3_senders_multiple_msg_1_receiver(self): - messages_num = 3 + messages_num = 10 total_senders = 3 self.node4 = WakuNode(NODE_1, f"node4_{self.test_id}") self.node5 = WakuNode(NODE_1, f"node5_{self.test_id}") @@ -258,7 +258,7 @@ def test_filter_3_senders_multiple_msg_1_receiver(self): @pytest.mark.timeout(60 * 5) def test_filter_many_subscribed_nodes(self): - max_subscribed_nodes = 2 + max_subscribed_nodes = 15 if STRESS_ENABLED: max_subscribed_nodes = 50 node_list = [] From 5a0feec9de3721aa72e1f4a950ab2d80b09634e6 Mon Sep 17 00:00:00 2001 From: aya Date: Thu, 7 Nov 2024 10:51:12 +0200 Subject: [PATCH 20/23] test_filter_3_senders_multiple_msg_1_receiver increase message_num to 12 --- tests/e2e/test_e2e.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index bf242d0763..17855b71c6 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -222,7 +222,7 @@ def test_filter_20_senders_1_receiver(self): @pytest.mark.timeout(60 * 7) def test_filter_3_senders_multiple_msg_1_receiver(self): - messages_num = 10 + messages_num = 12 total_senders = 3 self.node4 = WakuNode(NODE_1, f"node4_{self.test_id}") self.node5 = WakuNode(NODE_1, f"node5_{self.test_id}") From 27a5d6fa1f63dcbb2a2c5c14e9cbd31d4a1e2a2f Mon Sep 17 00:00:00 2001 From: aya Date: Thu, 7 Nov 2024 13:00:47 +0200 Subject: [PATCH 21/23] change max-connections to 50 instead of 1000 --- src/node/waku_node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/waku_node.py b/src/node/waku_node.py index 7c44e1bfbf..e5abb01c8a 100644 --- a/src/node/waku_node.py +++ b/src/node/waku_node.py @@ -117,7 +117,7 @@ def start(self, wait_for_node_sec=20, **kwargs): "rln-creds-id": None, "rln-creds-source": None, "nodekey": self.generate_random_nodekey(), - "max-connections": "1000", + "max-connections": "50", "filter-subscription-timeout": "600", } From c3a635a722c1b5b814f497621c4bee195c32d859 Mon Sep 17 00:00:00 2001 From: aya Date: Thu, 7 Nov 2024 13:51:40 +0200 Subject: [PATCH 22/23] commenting max-connection and filter timeout for CI failure --- src/env_vars.py | 2 +- src/node/waku_node.py | 4 ++-- tests/e2e/test_e2e.py | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/env_vars.py b/src/env_vars.py index fe4bddcf76..96eef55e1a 100644 --- a/src/env_vars.py +++ b/src/env_vars.py @@ -18,7 +18,7 @@ def get_env_var(var_name, default=None): DEFAULT_GOWAKU = "wakuorg/go-waku:latest" STRESS_ENABLED = False NODE_1 = get_env_var("NODE_1", DEFAULT_NWAKU) -NODE_2 = get_env_var("NODE_2", DEFAULT_NWAKU) +NODE_2 = get_env_var("NODE_2", DEFAULT_GOWAKU) ADDITIONAL_NODES = get_env_var("ADDITIONAL_NODES", f"{DEFAULT_NWAKU},{DEFAULT_GOWAKU},{DEFAULT_NWAKU}") # more nodes need to follow the NODE_X pattern DOCKER_LOG_DIR = get_env_var("DOCKER_LOG_DIR", "./log/docker") diff --git a/src/node/waku_node.py b/src/node/waku_node.py index e5abb01c8a..3669fa9339 100644 --- a/src/node/waku_node.py +++ b/src/node/waku_node.py @@ -117,8 +117,8 @@ def start(self, wait_for_node_sec=20, **kwargs): "rln-creds-id": None, "rln-creds-source": None, "nodekey": self.generate_random_nodekey(), - "max-connections": "50", - "filter-subscription-timeout": "600", + # "max-connections": "50", + # "filter-subscription-timeout": "600", } if self.is_gowaku(): diff --git a/tests/e2e/test_e2e.py b/tests/e2e/test_e2e.py index 17855b71c6..0d5c623083 100644 --- a/tests/e2e/test_e2e.py +++ b/tests/e2e/test_e2e.py @@ -181,6 +181,8 @@ def test_chain_of_relay_nodes(self): @pytest.mark.timeout(60 * 7) def test_filter_20_senders_1_receiver(self): total_senders = 20 + if "go-waku" in NODE_2: + total_senders = 10 node_list = [] logger.debug(f"Start {total_senders} nodes to publish messages ") @@ -190,7 +192,7 @@ def test_filter_20_senders_1_receiver(self): node_list.append(WakuNode(NODE_2, f"node{i + 1}_{self.test_id}")) delay(0.1) node_list[i + 1].start(relay="true", discv5_bootstrap_node=node_list[i].get_enr_uri()) - delay(2) + delay(3) logger.debug(f"Start filter node and subscribed filter node ") self.node21 = WakuNode(NODE_1, f"node21_{self.test_id}") @@ -207,7 +209,7 @@ def test_filter_20_senders_1_receiver(self): node.set_relay_subscriptions([self.test_pubsub_topic]) logger.debug(f"Node22 make filter request to pubsubtopic {self.test_pubsub_topic} and content topic {self.test_content_topic}") self.node22.set_filter_subscriptions({"requestId": "1", "contentFilters": [self.test_content_topic], "pubsubTopic": self.test_pubsub_topic}) - self.wait_for_autoconnection(node_list, hard_wait=50) + self.wait_for_autoconnection(node_list, hard_wait=80) logger.debug(f"{total_senders} Nodes publish {total_senders} messages") for node in node_list[:-1]: From 33bd7127a75e3c496142b5236b1cbc01f784252f Mon Sep 17 00:00:00 2001 From: aya Date: Thu, 7 Nov 2024 16:18:48 +0200 Subject: [PATCH 23/23] Revert timeout back to 20 --- src/env_vars.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/env_vars.py b/src/env_vars.py index 96eef55e1a..bdd008f075 100644 --- a/src/env_vars.py +++ b/src/env_vars.py @@ -18,7 +18,7 @@ def get_env_var(var_name, default=None): DEFAULT_GOWAKU = "wakuorg/go-waku:latest" STRESS_ENABLED = False NODE_1 = get_env_var("NODE_1", DEFAULT_NWAKU) -NODE_2 = get_env_var("NODE_2", DEFAULT_GOWAKU) +NODE_2 = get_env_var("NODE_2", DEFAULT_NWAKU) ADDITIONAL_NODES = get_env_var("ADDITIONAL_NODES", f"{DEFAULT_NWAKU},{DEFAULT_GOWAKU},{DEFAULT_NWAKU}") # more nodes need to follow the NODE_X pattern DOCKER_LOG_DIR = get_env_var("DOCKER_LOG_DIR", "./log/docker") @@ -27,7 +27,7 @@ def get_env_var(var_name, default=None): IP_RANGE = get_env_var("IP_RANGE", "172.18.0.0/24") GATEWAY = get_env_var("GATEWAY", "172.18.0.1") RUNNING_IN_CI = get_env_var("CI") -API_REQUEST_TIMEOUT = get_env_var("API_REQUEST_TIMEOUT", 50) +API_REQUEST_TIMEOUT = get_env_var("API_REQUEST_TIMEOUT", 20) RLN_CREDENTIALS = get_env_var("RLN_CREDENTIALS") PG_USER = get_env_var("POSTGRES_USER", "postgres") PG_PASS = get_env_var("POSTGRES_PASSWORD", "test123")