Fix order-dependent Gitaly specs failing
If spec/tasks/gitlab/cleanup_rake_spec.rb
preceded any of the Gitaly
request specs, it would import the cleanup.rake
and the global
function limit
. For some reason, the Protobuf implementation would use
the global function instead of the getter method (most likely due to https://github.com/protocolbuffers/protobuf/blob/8b0968625331457e79ba2e7eef5b35af3a95129e/ruby/ext/google/protobuf_c/message.c#L294-L296). For example:
def limit
puts "hi"
end
req = Gitaly::WikiGetAllPagesRequest.new
req.send(:limit)
hi
=> nil
To fix this problem, access the field value using the []
operator
instead.
Edited by Stan Hu