Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
05bc9edd
Commit
05bc9edd
authored
Sep 18, 2020
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stub Gitlab::JobWaiter#wait for tests
parent
117df1e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
spec/lib/gitlab/job_waiter_spec.rb
spec/lib/gitlab/job_waiter_spec.rb
+4
-0
spec/spec_helper.rb
spec/spec_helper.rb
+6
-0
No files found.
spec/lib/gitlab/job_waiter_spec.rb
View file @
05bc9edd
...
...
@@ -19,6 +19,10 @@ RSpec.describe Gitlab::JobWaiter do
describe
'#wait'
do
let
(
:waiter
)
{
described_class
.
new
(
2
)
}
before
do
allow_any_instance_of
(
described_class
).
to
receive
(
:wait
).
and_call_original
end
it
'returns when all jobs have been completed'
do
described_class
.
notify
(
waiter
.
key
,
'a'
)
described_class
.
notify
(
waiter
.
key
,
'b'
)
...
...
spec/spec_helper.rb
View file @
05bc9edd
...
...
@@ -233,6 +233,12 @@ RSpec.configure do |config|
# expect(Gitlab::Git::KeepAround).to receive(:execute).and_call_original
allow
(
Gitlab
::
Git
::
KeepAround
).
to
receive
(
:execute
)
# Stub these calls due to being expensive operations
# It can be reenabled for specific tests via:
#
# expect(Gitlab::JobWaiter).to receive(:wait).and_call_original
allow_any_instance_of
(
Gitlab
::
JobWaiter
).
to
receive
(
:wait
)
Gitlab
::
ProcessMemoryCache
.
cache_backend
.
clear
Sidekiq
::
Worker
.
clear_all
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment