From 4a41a0f5ef9fa1521d81ec92b6035bc0e8729ed6 Mon Sep 17 00:00:00 2001 From: Stanislav Kozlovski Date: Fri, 7 Dec 2018 21:04:43 +0000 Subject: [PATCH 1/2] Fix failing test in ConsumeBenchTest:test_multiple_consumers_specified_group_partitions_should_raise This test apparently never passed. The problem is that during the review of the Pull Request we forgot to update the test. --- tests/kafkatest/tests/core/consume_bench_test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/kafkatest/tests/core/consume_bench_test.py b/tests/kafkatest/tests/core/consume_bench_test.py index 641ec7c918e85..35d470c3ec50e 100644 --- a/tests/kafkatest/tests/core/consume_bench_test.py +++ b/tests/kafkatest/tests/core/consume_bench_test.py @@ -177,10 +177,10 @@ def test_multiple_consumers_random_group_partitions(self): def test_multiple_consumers_specified_group_partitions_should_raise(self): """ - Runs multiple consumers in to read messages from specific partitions. - Since a consumerGroup isn't specified, each consumer will get assigned a random group - and consume from all partitions + Runs multiple consumers in the same group to read messages from specific partitions. + It is an invalid configuration to provide a consumer group and specific partitions. """ + expected_error_msg = 'You may not specify an explicit partition assignment when using multiple consumers in the same group' self.produce_messages(self.active_topics, max_messages=20000) consume_spec = ConsumeBenchWorkloadSpec(0, TaskSpec.MAX_DURATION_MS, self.consumer_workload_service.consumer_node, @@ -198,7 +198,7 @@ def test_multiple_consumers_specified_group_partitions_should_raise(self): consume_workload.wait_for_done(timeout_sec=360) raise Exception("Should have raised an exception due to an invalid configuration") except RuntimeError as e: - if 'Will not split partitions' not in str(e): + if expected_error_msg not in str(e): raise RuntimeError("Unexpected Exception - " + str(e)) self.logger.info(e) From d23f60894fda1dca87382fed870be22f9f77ec66 Mon Sep 17 00:00:00 2001 From: Stanislav Kozlovski Date: Sat, 8 Dec 2018 17:22:04 +0000 Subject: [PATCH 2/2] Use shorter error message --- tests/kafkatest/tests/core/consume_bench_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kafkatest/tests/core/consume_bench_test.py b/tests/kafkatest/tests/core/consume_bench_test.py index 35d470c3ec50e..e731270646d4a 100644 --- a/tests/kafkatest/tests/core/consume_bench_test.py +++ b/tests/kafkatest/tests/core/consume_bench_test.py @@ -180,7 +180,7 @@ def test_multiple_consumers_specified_group_partitions_should_raise(self): Runs multiple consumers in the same group to read messages from specific partitions. It is an invalid configuration to provide a consumer group and specific partitions. """ - expected_error_msg = 'You may not specify an explicit partition assignment when using multiple consumers in the same group' + expected_error_msg = 'explicit partition assignment' self.produce_messages(self.active_topics, max_messages=20000) consume_spec = ConsumeBenchWorkloadSpec(0, TaskSpec.MAX_DURATION_MS, self.consumer_workload_service.consumer_node,