Stub Gitlab::JobWaiter#wait for tests
What does this MR do?
If WaitableWorker
receives arglist with a number of elements more than 3 and less than 100, the wait
method is called, which stops the execution for 10 seconds: https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/workers/concerns/waitable_worker.rb#L26
We can disable it for tests in order to optimize runtime of tests. Here is the list of the files which call wait
method and how many times it's called:
If we exclude 4 calls for spec/lib/gitlab/job_waiter_spec.rb
which controls the duration of the timeout, we have 24
calls. If we stub the calls, we'll win 4 minutes
of tests runtime and prevent from introducing future delays.
Edited by Igor Drozdov