Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
partition_movement_test: fix offset key error
Occassionally we would hit errors like the following: RunnerClient: rptest.tests.partition_movement_test.PartitionMovementTest.test_bootstrapping_after_move.num_to_upgrade=2: Summary: KeyError(1) Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/ducktape/tests/runner_client.py", line 135, in run data = self.run_test() File "/usr/local/lib/python3.9/dist-packages/ducktape/tests/runner_client.py", line 227, in run_test return self.test_context.function(self.test) File "/usr/local/lib/python3.9/dist-packages/ducktape/mark/_mark.py", line 476, in wrapper return functools.partial(f, *args, **kwargs)(*w_args, **w_kwargs) File "/root/tests/rptest/services/cluster.py", line 35, in wrapped r = f(self, *args, **kwargs) File "/root/tests/rptest/tests/partition_movement_test.py", line 410, in test_bootstrapping_after_move wait_until(offsets_are_recovered, 30, 2) File "/usr/local/lib/python3.9/dist-packages/ducktape/utils/util.py", line 53, in wait_until raise e File "/usr/local/lib/python3.9/dist-packages/ducktape/utils/util.py", line 44, in wait_until if condition(): File "/root/tests/rptest/tests/partition_movement_test.py", line 405, in offsets_are_recovered return all([ File "/root/tests/rptest/tests/partition_movement_test.py", line 406, in <listcomp> offset_map[p.id] == p.high_watermark KeyError: 1 It's possible that the command run by `describe_topic()` results in lines that don't match the partition line regex. The regex expects numeric values for each field, which isn't always the case e.g. if there's a leadership change. This commit adjusts the test to ensure there are three partitions in the returned output before proceeding.
- Loading branch information