Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/integration/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ def _create_topics_via_admin(broker, topic_names, num_partitions, replication_fa
admin = KafkaAdminClient(**params)
try:
topics = [NewTopic(name, num_partitions, replication_factor) for name in topic_names]
admin.create_topics(topics)
admin.create_topics(topics, wait_for_metadata=True)
except InvalidReplicationFactorError:
time.sleep(0.5)
topics = [NewTopic(name, num_partitions, replication_factor) for name in topic_names]
admin.create_topics(topics)
admin.create_topics(topics, wait_for_metadata=True)
finally:
admin.close()

Expand Down
2 changes: 2 additions & 0 deletions test/integration/test_consumer_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def test_consumer(consumer):


def test_consumer_topics(consumer, topic):
# The `topic` fixture waits for the topic to be visible in broker
# metadata before returning, so a single poll + fetch is sufficient here.
consumer.poll(timeout_ms=500)
assert topic in consumer.topics()
assert len(consumer.partitions_for_topic(topic)) > 0
Expand Down
Loading