From b63cd6370f53fe8e1e2201c29b03a3e75dbd3db8 Mon Sep 17 00:00:00 2001 From: Colin Hicks Date: Wed, 10 Oct 2018 18:16:54 -0400 Subject: [PATCH] MINOR: Adjust test params pursuant to KAFKA-4514. (#5777) PR #2267 Introduced support for Zstandard compression. The relevant test expects values for `num_nodes` and `num_producers` based on the (now-incremented) count of compression types. Passed the affected, previously-failing test: `ducker-ak test tests/kafkatest/tests/client/compression_test.py` Reviewers: Jason Gustafson --- tests/kafkatest/tests/client/compression_test.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/kafkatest/tests/client/compression_test.py b/tests/kafkatest/tests/client/compression_test.py index 2085d9b6259c..23b30eac24c0 100644 --- a/tests/kafkatest/tests/client/compression_test.py +++ b/tests/kafkatest/tests/client/compression_test.py @@ -29,6 +29,7 @@ class CompressionTest(ProduceConsumeValidateTest): """ These tests validate produce / consume for compressed topics. """ + COMPRESSION_TYPES = ["snappy", "gzip", "lz4", "zstd", "none"] def __init__(self, test_context): """:type test_context: ducktape.tests.test.TestContext""" @@ -42,7 +43,7 @@ def __init__(self, test_context): self.num_partitions = 10 self.timeout_sec = 60 self.producer_throughput = 1000 - self.num_producers = 4 + self.num_producers = len(self.COMPRESSION_TYPES) self.messages_per_producer = 1000 self.num_consumers = 1 @@ -53,15 +54,15 @@ def min_cluster_size(self): # Override this since we're adding services outside of the constructor return super(CompressionTest, self).min_cluster_size() + self.num_producers + self.num_consumers - @cluster(num_nodes=7) - @parametrize(compression_types=["snappy","gzip","lz4","zstd","none"]) + @cluster(num_nodes=8) + @parametrize(compression_types=COMPRESSION_TYPES) def test_compressed_topic(self, compression_types): """Test produce => consume => validate for compressed topics Setup: 1 zk, 1 kafka node, 1 topic with partitions=10, replication-factor=1 compression_types parameter gives a list of compression types (or no compression if - "none"). Each producer in a VerifiableProducer group (num_producers = 4) will use a - compression type from the list based on producer's index in the group. + "none"). Each producer in a VerifiableProducer group (num_producers = number of compression + types) will use a compression type from the list based on producer's index in the group. - Produce messages in the background - Consume messages in the background