From 6897daa4ceeb3b6ae05a749f29fae636cc01f40c Mon Sep 17 00:00:00 2001 From: Jarkko Jaakola Date: Fri, 20 Sep 2024 16:04:13 +0300 Subject: [PATCH] test: remove flaky TestCommitted test The test is naturally flaky. The lowest timeout is 1 ms and it is possible to get the response in that time from Kafka. The super class cannot be mocked easily as it is immutable. --- tests/integration/kafka/test_consumer.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/integration/kafka/test_consumer.py b/tests/integration/kafka/test_consumer.py index af1af6d2b..84c69d76d 100644 --- a/tests/integration/kafka/test_consumer.py +++ b/tests/integration/kafka/test_consumer.py @@ -4,7 +4,7 @@ """ from __future__ import annotations -from aiokafka.errors import IllegalStateError, KafkaTimeoutError, UnknownTopicOrPartitionError +from aiokafka.errors import IllegalStateError, UnknownTopicOrPartitionError from confluent_kafka import OFFSET_BEGINNING, OFFSET_END, TopicPartition from confluent_kafka.admin import NewTopic from confluent_kafka.error import KafkaError @@ -180,12 +180,6 @@ def test_commit_raises_for_unknown_partition( consumer.commit(offsets=[TopicPartition(new_topic.topic, partition=99, offset=0)]) -class TestCommitted: - def test_committed_raises_on_timeout(self, consumer: KafkaConsumer) -> None: - with pytest.raises(KafkaTimeoutError): - consumer.committed([], timeout=0.00001) - - class TestSubscribe: def _poll_until_no_message(self, consumer: KafkaConsumer) -> None: """Polls until there is no message returned.