From 8b05ee8da50b4c7b832676f4e38f9d92a86639cc Mon Sep 17 00:00:00 2001 From: Taras Voinarovskyi Date: Wed, 25 Oct 2017 07:28:35 +0900 Subject: Add DefaultRecordBatch implementation aka V2 message format parser/builder. (#1185) Added bytecode optimization for varint and append/read_msg functions. Mostly based on avoiding LOAD_GLOBAL calls. --- test/test_producer.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'test/test_producer.py') diff --git a/test/test_producer.py b/test/test_producer.py index 41bd52e..20dffc2 100644 --- a/test/test_producer.py +++ b/test/test_producer.py @@ -88,10 +88,7 @@ def test_kafka_producer_proper_record_metadata(kafka_broker, compression): retries=5, max_block_ms=10000, compression_type=compression) - if producer.config['api_version'] >= (0, 10): - magic = 1 - else: - magic = 0 + magic = producer._max_usable_produce_magic() topic = random_string(5) future = producer.send( @@ -109,7 +106,9 @@ def test_kafka_producer_proper_record_metadata(kafka_broker, compression): else: assert record.timestamp == -1 # NO_TIMESTAMP - if magic == 1: + if magic >= 2: + assert record.checksum is None + elif magic == 1: assert record.checksum == 1370034956 else: assert record.checksum == 3296137851 -- cgit v1.2.1