Skip to content

Commit

Permalink
Lower number for equal consumption test, so we don't get timeout on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
tvoinarovskyi committed Nov 7, 2016
1 parent ab60c24 commit 317d339
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/test_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,19 +450,18 @@ def test_check_extended_message_record(self):
def test_equal_consumption(self):
# A strange use case of kafka-python, that can be reproduced in
# aiokafka https://github.com/dpkp/kafka-python/issues/675
yield from self.send_messages(0, list(range(1000)))
yield from self.send_messages(1, list(range(1000)))
yield from self.send_messages(0, list(range(200)))
yield from self.send_messages(1, list(range(200)))

partition_consumption = [0, 0]
for x in range(10):
consumer = yield from self.consumer_factory(
max_partition_fetch_bytes=10000)
for x in range(50):
for x in range(10):
msg = yield from consumer.getone()
partition_consumption[msg.partition] += 1
yield from consumer.stop()

print(partition_consumption)
diff = abs(partition_consumption[0] - partition_consumption[1])
# We are good as long as it's not 100%, as we do rely on randomness of
# a shuffle in code. Ideally it should be 50/50 (0 diff) thou
Expand Down

0 comments on commit 317d339

Please sign in to comment.