diff --git a/src/steps/light_push.py b/src/steps/light_push.py index 52eedb62c..fd7da42d0 100644 --- a/src/steps/light_push.py +++ b/src/steps/light_push.py @@ -68,11 +68,11 @@ class StepsLightPush(StepsCommon): self.start_receiving_node(node, node_index=index + 2, lightpush="true", relay="true", pubsub_topic=self.test_pubsub_topic, **kwargs) @allure.step - def setup_first_lightpush_node(self, lightpush="true", relay="false", **kwargs): + def setup_first_lightpush_node(self, lightpush="true", relay="true", **kwargs): self.light_push_node1 = self.setup_lightpush_node(NODE_2, node_index=1, lightpush=lightpush, relay=relay, **kwargs) @allure.step - def setup_second_lightpush_node(self, lightpush="true", relay="false", **kwargs): + def setup_second_lightpush_node(self, lightpush="true", relay="true", **kwargs): self.light_push_node2 = self.setup_lightpush_node(NODE_2, node_index=2, lightpush=lightpush, relay=relay, **kwargs) @allure.step @@ -83,7 +83,7 @@ class StepsLightPush(StepsCommon): pytest.skip("ADDITIONAL_NODES/node_list is empty, cannot run test") self.additional_lightpush_nodes = [] for index, node in enumerate(nodes): - node = self.setup_lightpush_node(node, node_index=index + 2, lightpush="true", relay="false", **kwargs) + node = self.setup_lightpush_node(node, node_index=index + 2, lightpush="true", relay="true", **kwargs) self.additional_lightpush_nodes.append(node) @allure.step diff --git a/src/test_data.py b/src/test_data.py index 6cba58c2d..02ad8c2fc 100644 --- a/src/test_data.py +++ b/src/test_data.py @@ -337,7 +337,7 @@ METRICS_WITH_INITIAL_VALUE_ZERO = [ "waku_px_peers_received_total", "waku_px_peers_received_unknown", "waku_px_peers_sent_total", - "waku_px_peers_cached", + "waku_px_peers", "waku_histogram_message_size_sum", "waku_histogram_message_size_count", 'waku_histogram_message_size_bucket{le="0.0"}', diff --git a/tests/e2e/test_network_conditions.py b/tests/e2e/test_network_conditions.py index b94414b8f..6ee69e3ce 100644 --- a/tests/e2e/test_network_conditions.py +++ b/tests/e2e/test_network_conditions.py @@ -322,6 +322,7 @@ class TestNetworkConditions(StepsRelay): self.tc.clear(self.node1) + @pytest.mark.xfail(reason="Fails under high packet loss percentage 60") def test_relay_4_nodes_sender_packet_loss_50_15sec_timeout(self): self.node3 = WakuNode(NODE_2, f"node3_{self.test_id}") self.node4 = WakuNode(NODE_2, f"node4_{self.test_id}") @@ -365,6 +366,7 @@ class TestNetworkConditions(StepsRelay): assert received > int(total_msgs * 0.8), "No messages received under 50% packet loss" @pytest.mark.timeout(60 * 10) + @pytest.mark.xfail(reason="Fails under high packet loss percentage") @pytest.mark.parametrize("loss", [40.0, 60.0], ids=["loss40", "loss60"]) def test_relay_4_nodes_sender_packet_loss_delivery_ratio_simple(self, loss): self.node3 = WakuNode(NODE_2, f"node3_{self.test_id}") diff --git a/tests/light_push/test_multiple_nodes.py b/tests/light_push/test_multiple_nodes.py index 17f5880f5..c3bdf81a0 100644 --- a/tests/light_push/test_multiple_nodes.py +++ b/tests/light_push/test_multiple_nodes.py @@ -1,3 +1,4 @@ +import pytest from src.env_vars import NODE_1 from src.libs.common import delay from src.steps.light_push import StepsLightPush @@ -7,14 +8,14 @@ class TestMultipleNodes(StepsLightPush): def test_2_receiving_nodes__relay_node1_forwards_lightpushed_message_to_relay_node2(self): self.setup_first_receiving_node(lightpush="true", relay="true") self.setup_second_receiving_node(lightpush="false", relay="true") - self.setup_first_lightpush_node(lightpush="true", relay="false") + self.setup_first_lightpush_node(lightpush="true", relay="true") self.subscribe_to_pubsub_topics_via_relay() self.check_light_pushed_message_reaches_receiving_peer(sender=self.light_push_node1) def test_2_receiving_nodes__relay_node1_forwards_lightpushed_message_to_filter_node2(self): self.setup_first_receiving_node(lightpush="true", relay="true", filter="true") self.setup_second_receiving_node(lightpush="false", relay="false", filternode=self.receiving_node1.get_multiaddr_with_id()) - self.setup_first_lightpush_node(lightpush="true", relay="false") + self.setup_first_lightpush_node(lightpush="true", relay="true") helper_node = self.start_receiving_node(NODE_1, node_index=4, lightpush="false", relay="true") self.subscribe_to_pubsub_topics_via_relay(node=[self.receiving_node1, helper_node]) self.subscribe_to_pubsub_topics_via_filter(node=self.receiving_node2) @@ -22,6 +23,7 @@ class TestMultipleNodes(StepsLightPush): get_messages_response = self.receiving_node2.get_filter_messages(self.test_content_topic) assert len(get_messages_response) == 1, "Lightpushed message was not relayed to the filter node" + @pytest.mark.skip(reason=" test has m=no meaning now as relay = false won't work , moght be used in future if relay = false work again") def test_2_lightpush_nodes_and_2_receiving_nodes(self): self.setup_first_receiving_node(lightpush="true", relay="true") self.setup_second_receiving_node(lightpush="false", relay="true") @@ -34,28 +36,26 @@ class TestMultipleNodes(StepsLightPush): def test_combination_of_different_nodes(self): self.setup_first_receiving_node(lightpush="true", relay="true", filter="true") self.setup_second_receiving_node(lightpush="false", relay="false", filternode=self.receiving_node1.get_multiaddr_with_id()) - self.setup_first_lightpush_node(lightpush="true", relay="false") self.setup_second_lightpush_node(lightpush="true", relay="true") self.subscribe_to_pubsub_topics_via_relay(node=self.receiving_node1) self.subscribe_to_pubsub_topics_via_relay(node=self.light_push_node2) self.subscribe_to_pubsub_topics_via_filter(node=self.receiving_node2) delay(1) - self.check_light_pushed_message_reaches_receiving_peer(sender=self.light_push_node1) self.check_light_pushed_message_reaches_receiving_peer(sender=self.light_push_node2) get_messages_response = self.receiving_node2.get_filter_messages(self.test_content_topic) - assert len(get_messages_response) == 2, "Lightpushed message was not relayed to the filter node" + assert len(get_messages_response) == 1, "Lightpushed message was not relayed to the filter node" def test_multiple_receiving_nodes(self): self.setup_first_receiving_node(lightpush="true", relay="true") self.setup_additional_receiving_nodes() - self.setup_first_lightpush_node(lightpush="true", relay="false") + self.setup_first_lightpush_node(lightpush="true", relay="true") self.subscribe_to_pubsub_topics_via_relay() self.check_light_pushed_message_reaches_receiving_peer(sender=self.light_push_node1) def test_multiple_lightpush_nodes(self): self.setup_first_receiving_node(lightpush="true", relay="true") self.setup_second_receiving_node(lightpush="false", relay="true") - self.setup_first_lightpush_node(lightpush="true", relay="false") + self.setup_first_lightpush_node(lightpush="true", relay="true") self.setup_additional_lightpush_nodes() self.subscribe_to_pubsub_topics_via_relay() self.check_light_pushed_message_reaches_receiving_peer(sender=self.light_push_node1) diff --git a/tests/light_push/test_running_nodes.py b/tests/light_push/test_running_nodes.py index 84efc78f1..d0aba7d3f 100644 --- a/tests/light_push/test_running_nodes.py +++ b/tests/light_push/test_running_nodes.py @@ -1,8 +1,10 @@ +import pytest from src.libs.common import delay from src.steps.light_push import StepsLightPush class TestRunningNodes(StepsLightPush): + @pytest.mark.skip(reason="lightpush no longer wroks with relay =false") def test_main_node_only_lightpush__peer_only_lightpush(self): self.setup_first_receiving_node(lightpush="true", relay="false") self.setup_first_lightpush_node(lightpush="true", relay="false") @@ -12,19 +14,19 @@ class TestRunningNodes(StepsLightPush): except Exception as ex: assert "no waku relay found" in str(ex) or "failed to negotiate protocol: protocols not supported" in str(ex) - def test_main_node_only_lightpush__peer_only_filter(self): + def test_main_node_relay_lightpush__peer_only_filter(self): self.setup_first_receiving_node(lightpush="false", relay="false", filter="true") - self.setup_first_lightpush_node(lightpush="true", relay="false") + self.setup_first_lightpush_node(lightpush="true", relay="true") try: self.light_push_node1.send_light_push_message(self.create_payload()) raise AssertionError("Light push with non lightpush peer worked!!!") except Exception as ex: assert "Failed to request a message push: dial_failure" in str(ex) or "lightpush error" in str(ex) - def test_main_node_only_lightpush__peer_only_relay(self): + def test_main_node_relay_lightpush__peer_only_relay(self): self.setup_first_receiving_node(lightpush="false", relay="true") self.subscribe_to_pubsub_topics_via_relay() - self.setup_first_lightpush_node(lightpush="true", relay="false") + self.setup_first_lightpush_node(lightpush="true", relay="true") try: self.light_push_node1.send_light_push_message(self.create_payload()) raise AssertionError("Light push with non lightpush peer worked!!!") @@ -34,7 +36,7 @@ class TestRunningNodes(StepsLightPush): def test_main_node_only_lightpush__peer_full(self): self.setup_first_receiving_node(lightpush="true", relay="true", filter="true") self.setup_second_receiving_node(lightpush="false", relay="true") - self.setup_first_lightpush_node(lightpush="true", relay="false") + self.setup_first_lightpush_node(lightpush="true", relay="true") self.subscribe_to_pubsub_topics_via_relay() self.check_light_pushed_message_reaches_receiving_peer() @@ -57,7 +59,7 @@ class TestRunningNodes(StepsLightPush): def test_lightpush_with_a_single_receiving_node(self): self.setup_first_receiving_node(lightpush="true", relay="true") - self.setup_first_lightpush_node(lightpush="true", relay="false") + self.setup_first_lightpush_node(lightpush="true", relay="true") self.subscribe_to_pubsub_topics_via_relay() try: self.check_light_pushed_message_reaches_receiving_peer(sender=self.light_push_node1)