Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve test/test_consumer_integration.py in GitHub runner #194

Merged
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
6 changes: 3 additions & 3 deletions test/test_consumer_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_kafka_consumer_unsupported_encoding(

@pytest.mark.skipif(not env_kafka_version(), reason="No KAFKA_VERSION set")
def test_kafka_consumer__blocking(kafka_consumer_factory, topic, send_messages):
TIMEOUT_MS = 500
TIMEOUT_MS = 1000
consumer = kafka_consumer_factory(auto_offset_reset='earliest',
enable_auto_commit=False,
consumer_timeout_ms=TIMEOUT_MS)
Expand All @@ -70,7 +70,7 @@ def test_kafka_consumer__blocking(kafka_consumer_factory, topic, send_messages):
consumer.unsubscribe()
consumer.assign([TopicPartition(topic, 0)])

# Ask for 5 messages, nothing in queue, block 500ms
# Ask for 5 messages, nothing in queue, block 1000ms
with Timer() as t:
with pytest.raises(StopIteration):
msg = next(consumer)
Expand All @@ -87,7 +87,7 @@ def test_kafka_consumer__blocking(kafka_consumer_factory, topic, send_messages):
assert_message_count(messages, 5)
assert t.interval < (TIMEOUT_MS / 1000.0)

# Ask for 10 messages, get 5 back, block 500ms
# Ask for 10 messages, get 5 back, block 1000ms
messages = []
with Timer() as t:
with pytest.raises(StopIteration):
Expand Down
Loading