You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: collapsed_consecutive_errors_accumulation_spec.rb
    path of file: ./repos/karafka/spec/integrations/pro/consumption/strategies/vp/errors_tracking
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# When using virtual partitions and tracking errors, they under consecutive collapse should grow
# in terms of size

setup_karafka(allow_errors: %w[consum
    
def contains_subsequence?(main_array, sub_array)
  return true if sub_array.empty?

  sub_index = 0
  main_array.each do |element|
    sub_index += 1 if element == sub_array[sub_index]
    return true if sub_index == sub_array.length
  end

  false
end