KAFKA-10300 fix flaky core/group_mode_transactions_test.py (#9059)

the root cause is same to #9026 so I copy the approach of #9026 to resolve core/group_mode_transactions_test.py

Reviewers: Jun Rao <junrao@gmail.com>
This commit is contained in:
Chia-Ping Tsai 2020-07-24 06:59:57 +08:00 committed by GitHub
parent 0b181fdde5
commit 0d5c967073
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 3 deletions

View File

@ -50,7 +50,14 @@ class GroupModeTransactionsTest(Test):
self.num_copiers = 3 self.num_copiers = 3
self.num_seed_messages = 100000 self.num_seed_messages = 100000
self.transaction_size = 750 self.transaction_size = 750
self.transaction_timeout = 10000 # The transaction timeout should be lower than the progress timeout, but at
# least as high as the request timeout (which is 30s by default). When the
# client is hard-bounced, progress may depend on the previous transaction
# being aborted. When the broker is hard-bounced, we may have to wait as
# long as the request timeout to get a `Produce` response and we do not
# want the coordinator timing out the transaction.
self.transaction_timeout = 40000
self.progress_timeout_sec = 60
self.consumer_group = "grouped-transactions-test-consumer-group" self.consumer_group = "grouped-transactions-test-consumer-group"
self.zk = ZookeeperService(test_context, num_nodes=1) self.zk = ZookeeperService(test_context, num_nodes=1)
@ -120,9 +127,9 @@ class GroupModeTransactionsTest(Test):
for _ in range(3): for _ in range(3):
for copier in copiers: for copier in copiers:
wait_until(lambda: copier.progress_percent() >= 20.0, wait_until(lambda: copier.progress_percent() >= 20.0,
timeout_sec=timeout_sec, timeout_sec=self.progress_timeout_sec,
err_msg="%s : Message copier didn't make enough progress in %ds. Current progress: %s" \ err_msg="%s : Message copier didn't make enough progress in %ds. Current progress: %s" \
% (copier.transactional_id, timeout_sec, str(copier.progress_percent()))) % (copier.transactional_id, self.progress_timeout_sec, str(copier.progress_percent())))
self.logger.info("%s - progress: %s" % (copier.transactional_id, self.logger.info("%s - progress: %s" % (copier.transactional_id,
str(copier.progress_percent()))) str(copier.progress_percent())))
copier.restart(clean_shutdown) copier.restart(clean_shutdown)