fixes for latest failures and bugfixes (#17)

* fixes for latest failures and bugfixes

* other fixes
This commit is contained in:
Florin Barbu 2024-02-15 14:58:20 +02:00 committed by GitHub
parent 8cb44f1201
commit 98c76dc214
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 7 additions and 29 deletions

View File

@ -44,5 +44,3 @@ class WakuMessage:
assert str(message.meta) == str(sent_message["meta"]), assert_fail_message("meta")
if "ephemeral" in sent_message:
assert str(message.ephemeral) == str(sent_message["ephemeral"]), assert_fail_message("ephemeral")
if "rateLimitProof" in sent_message:
assert str(message.rateLimitProof) == str(sent_message["rateLimitProof"]), assert_fail_message("rateLimitProof")

View File

@ -1,6 +1,5 @@
import inspect
import os
from datetime import datetime
from uuid import uuid4
from src.libs.custom_logger import get_custom_logger
@ -14,7 +13,6 @@ from src.env_vars import (
NODE_2,
ADDITIONAL_NODES,
NODEKEY,
RUNNING_IN_CI,
DEFAULT_NWAKU,
RLN_CREDENTIALS,
)
@ -129,7 +127,7 @@ class StepsRelay:
# we need much bigger timeout in CI because we run tests in parallel there and the machine itself is slower
@allure.step
def wait_for_published_message_to_reach_relay_peer(
self, timeout_duration=120 if RUNNING_IN_CI else 20, time_between_retries=1, pubsub_topic=None, sender=None, peer_list=None
self, timeout_duration=120, time_between_retries=1, pubsub_topic=None, sender=None, peer_list=None
):
@retry(stop=stop_after_delay(timeout_duration), wait=wait_fixed(time_between_retries), reraise=True)
def check_peer_connection():
@ -155,7 +153,7 @@ class StepsRelay:
return message
@allure.step
@retry(stop=stop_after_delay(30), wait=wait_fixed(1), reraise=True)
@retry(stop=stop_after_delay(120), wait=wait_fixed(1), reraise=True)
def subscribe_and_publish_with_retry(self, node_list, pubsub_topic_list):
self.ensure_relay_subscriptions_on_nodes(node_list, pubsub_topic_list)
self.check_published_message_reaches_relay_peer()

View File

@ -39,11 +39,10 @@ class TestFilterGetMessages(StepsFilter):
def test_filter_get_message_with_version(self):
self.check_published_message_reaches_filter_peer(self.create_message(version=10))
@pytest.mark.xfail("nwaku" in NODE_1 or "nwaku" in NODE_2, reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
def test_filter_get_message_with_meta(self):
self.check_published_message_reaches_filter_peer(self.create_message(meta=to_base64(self.test_payload)))
@pytest.mark.xfail(reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
@pytest.mark.xfail(reason="Bug reported: https://github.com/waku-org/nwaku/issues/2436")
def test_filter_get_message_with_ephemeral(self):
failed_ephemeral = []
for ephemeral in [True, False]:
@ -55,15 +54,6 @@ class TestFilterGetMessages(StepsFilter):
failed_ephemeral.append(ephemeral)
assert not failed_ephemeral, f"Ephemeral that failed: {failed_ephemeral}"
@pytest.mark.xfail(reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
def test_filter_get_message_with_rate_limit_proof(self):
rate_limit_proof = {
"proof": to_base64("proofData"),
"epoch": to_base64("epochData"),
"nullifier": to_base64("nullifierData"),
}
self.check_published_message_reaches_filter_peer(self.create_message(rateLimitProof=rate_limit_proof))
def test_filter_get_message_with_extra_field(self):
try:
self.check_published_message_reaches_filter_peer(self.create_message(extraField="extraValue"))

View File

@ -32,4 +32,4 @@ class TestRelayMultipleNodes(StepsRelay):
def test_relay_get_message_after_one_peer_was_stopped(self, subscribe_optional_relay_nodes, relay_warm_up):
self.check_published_message_reaches_relay_peer(peer_list=self.main_nodes + self.optional_nodes)
self.node2.stop()
self.check_published_message_reaches_relay_peer(peer_list=self.optional_nodes)
self.wait_for_published_message_to_reach_relay_peer(peer_list=self.optional_nodes)

View File

@ -158,7 +158,6 @@ class TestRelayPublish(StepsRelay):
except Exception as ex:
assert "Bad Request" in str(ex)
@pytest.mark.xfail("nwaku" in NODE_1 or "nwaku" in NODE_2, reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
def test_publish_with_valid_meta(self):
self.check_published_message_reaches_relay_peer(self.create_message(meta=to_base64(self.test_payload)))
@ -169,7 +168,7 @@ class TestRelayPublish(StepsRelay):
except Exception as ex:
assert "Bad Request" in str(ex)
@pytest.mark.xfail(reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
@pytest.mark.xfail(reason="Bug reported: https://github.com/waku-org/nwaku/issues/2436")
def test_publish_with_ephemeral(self):
failed_ephemeral = []
for ephemeral in [True, False]:
@ -181,15 +180,6 @@ class TestRelayPublish(StepsRelay):
failed_ephemeral.append(ephemeral)
assert not failed_ephemeral, f"Ephemeral that failed: {failed_ephemeral}"
@pytest.mark.xfail(reason="Bug reported: https://github.com/waku-org/nwaku/issues/2214")
def test_publish_with_rate_limit_proof(self):
rate_limit_proof = {
"proof": to_base64("proofData"),
"epoch": to_base64("epochData"),
"nullifier": to_base64("nullifierData"),
}
self.check_published_message_reaches_relay_peer(self.create_message(rateLimitProof=rate_limit_proof))
def test_publish_with_extra_field(self):
try:
self.check_published_message_reaches_relay_peer(self.create_message(extraField="extraValue"))

View File

@ -1,4 +1,5 @@
import pytest
from src.env_vars import NODE_2
from src.libs.custom_logger import get_custom_logger
from src.steps.relay import StepsRelay
from src.test_data import INVALID_PUBSUB_TOPICS, VALID_PUBSUB_TOPICS
@ -47,6 +48,7 @@ class TestRelaySubscribe(StepsRelay):
self.delete_relay_subscriptions_on_nodes(self.main_nodes, [self.test_pubsub_topic])
self.check_publish_without_relay_subscription(self.test_pubsub_topic)
@pytest.mark.xfail("go-waku" in NODE_2, reason="Bug reported: https://github.com/waku-org/go-waku/issues/1034")
def test_relay_unsubscribe_from_all_pubsub_topics(self):
self.ensure_relay_subscriptions_on_nodes(self.main_nodes, VALID_PUBSUB_TOPICS)
for pubsub_topic in VALID_PUBSUB_TOPICS: