Skip to content

Commit

Permalink
tests: increase confluent tests timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Lancetnik committed Aug 7, 2024
1 parent 24a0de6 commit 81771b5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
async def test_handle():
async with TestKafkaBroker(broker, with_real=True) as br:
await br.publish({"name": "John", "user_id": 1}, topic="test-topic-confluent")
await handle.wait_call(timeout=20)
await handle.wait_call(timeout=30)
handle.mock.assert_called_once_with({"name": "John", "user_id": 1})

assert handle.mock is None
Expand All @@ -20,6 +20,6 @@ async def test_validation_error():
async with TestKafkaBroker(broker, with_real=True) as br:
with pytest.raises(ValidationError):
await br.publish("wrong message", topic="test-confluent-wrong-fields")
await wrong_handle.wait_call(timeout=20)
await wrong_handle.wait_call(timeout=30)

wrong_handle.mock.assert_called_once_with("wrong message")
1 change: 1 addition & 0 deletions faststream/nats/subscriber/usecase.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import asyncio
from abc import abstractmethod
from contextlib import suppress
from functools import cached_property
from typing import (
TYPE_CHECKING,
Any,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async def test_broker_context_confluent():
from faststream.confluent import TestKafkaBroker as TestConfluentKafkaBroker

async with TestConfluentKafkaBroker(broker, with_real=True), TestApp(app):
await handle.wait_call(20)
await handle.wait_call(30)
handle.mock.assert_called_once_with("Hi!")


Expand Down
9 changes: 6 additions & 3 deletions tests/opentelemetry/kafka/test_kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ async def test_batch(
expected_link_count = 1
expected_link_attrs = {"messaging.batch.message_count": 3}

@broker.subscriber(queue, batch=True, **self.subscriber_kwargs)
args, kwargs = self.get_subscriber_params(queue, batch=True)
@broker.subscriber(*args, **kwargs)
async def handler(m):
mock(m)
event.set()
Expand Down Expand Up @@ -131,7 +132,8 @@ async def test_batch_publish_with_single_consume(
expected_span_count = 8
expected_pub_batch_count = 1

@broker.subscriber(queue, **self.subscriber_kwargs)
args, kwargs = self.get_subscriber_params(queue)
@broker.subscriber(*args, **kwargs)
async def handler(msg):
await msgs_queue.put(msg)

Expand Down Expand Up @@ -189,7 +191,8 @@ async def test_single_publish_with_batch_consume(
expected_span_count = 6
expected_process_batch_count = 1

@broker.subscriber(queue, batch=True, **self.subscriber_kwargs)
args, kwargs = self.get_subscriber_params(queue, batch=True)
@broker.subscriber(*args, **kwargs)
async def handler(m):
m.sort()
mock(m)
Expand Down

0 comments on commit 81771b5

Please sign in to comment.