kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [kafka] branch 2.6 updated: MINOR: Fix flaky system test assertion after static member fencing (#9033)
Date Fri, 17 Jul 2020 18:29:43 GMT
This is an automated email from the ASF dual-hosted git repository.

jgus pushed a commit to branch 2.6
in repository https://gitbox.apache.org/repos/asf/kafka.git

The following commit(s) were added to refs/heads/2.6 by this push:
     new 2020262  MINOR: Fix flaky system test assertion after static member fencing (#9033)
2020262 is described below

commit 2020262ea58f08593eecb4663efec29f53f45d8c
Author: Jason Gustafson <jason@confluent.io>
AuthorDate: Fri Jul 17 11:27:33 2020 -0700

    MINOR: Fix flaky system test assertion after static member fencing (#9033)
    The test case `OffsetValidationTest.test_fencing_static_consumer` fails periodically due
to this error:
    Traceback (most recent call last):
      File "/home/jenkins/workspace/system-test-kafka_2.6/kafka/venv/lib/python2.7/site-packages/ducktape-0.7.8-py2.7.egg/ducktape/tests/runner_client.py",
line 134, in run
        data = self.run_test()
      File "/home/jenkins/workspace/system-test-kafka_2.6/kafka/venv/lib/python2.7/site-packages/ducktape-0.7.8-py2.7.egg/ducktape/tests/runner_client.py",
line 192, in run_test
        return self.test_context.function(self.test)
      File "/home/jenkins/workspace/system-test-kafka_2.6/kafka/venv/lib/python2.7/site-packages/ducktape-0.7.8-py2.7.egg/ducktape/mark/_mark.py",
line 429, in wrapper
        return functools.partial(f, *args, **kwargs)(*w_args, **w_kwargs)
      File "/home/jenkins/workspace/system-test-kafka_2.6/kafka/tests/kafkatest/tests/client/consumer_test.py",
line 257, in test_fencing_static_consumer
        assert len(consumer.dead_nodes()) == num_conflict_consumers
    When a consumer stops, there is some latency between when the shutdown is observed by
the service and when the node is added to the dead nodes. This patch fixes the problem by
giving some time for the assertion to be satisfied.
    Reviewers: Boyang Chen <boyang@confluent.io>
 tests/kafkatest/tests/client/consumer_test.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/kafkatest/tests/client/consumer_test.py b/tests/kafkatest/tests/client/consumer_test.py
index 131123f..731a24d 100644
--- a/tests/kafkatest/tests/client/consumer_test.py
+++ b/tests/kafkatest/tests/client/consumer_test.py
@@ -254,7 +254,9 @@ class OffsetValidationTest(VerifiableConsumerTest):
             self.await_members(conflict_consumer, num_conflict_consumers)
             self.await_members(consumer, len(consumer.nodes) - num_conflict_consumers)
-            assert len(consumer.dead_nodes()) == num_conflict_consumers
+            wait_until(lambda: len(consumer.dead_nodes()) == num_conflict_consumers,
+                       timeout_sec=10,
+                       err_msg="Timed out waiting for the fenced consumers to stop")

View raw message