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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
433b6d2c
Commit
433b6d2c
authored
Jul 13, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more specs for background migrations queue processing
parent
2a0ead2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
spec/lib/gitlab/background_migration_spec.rb
spec/lib/gitlab/background_migration_spec.rb
+18
-1
No files found.
spec/lib/gitlab/background_migration_spec.rb
View file @
433b6d2c
...
@@ -36,9 +36,10 @@ describe Gitlab::BackgroundMigration do
...
@@ -36,9 +36,10 @@ describe Gitlab::BackgroundMigration do
end
end
context
'when there are scheduled jobs present'
,
:sidekiq
,
:redis
do
context
'when there are scheduled jobs present'
,
:sidekiq
,
:redis
do
it
'steals all jobs from the schedule sets'
do
it
'steals all jobs from the schedule
d
sets'
do
Sidekiq
::
Testing
.
disable!
do
Sidekiq
::
Testing
.
disable!
do
BackgroundMigrationWorker
.
perform_in
(
10
.
minutes
,
'Object'
)
BackgroundMigrationWorker
.
perform_in
(
10
.
minutes
,
'Object'
)
expect
(
Sidekiq
::
ScheduledSet
.
new
).
to
be_one
expect
(
Sidekiq
::
ScheduledSet
.
new
).
to
be_one
expect
(
described_class
).
to
receive
(
:perform
).
with
(
'Object'
,
any_args
)
expect
(
described_class
).
to
receive
(
:perform
).
with
(
'Object'
,
any_args
)
...
@@ -48,6 +49,22 @@ describe Gitlab::BackgroundMigration do
...
@@ -48,6 +49,22 @@ describe Gitlab::BackgroundMigration do
end
end
end
end
end
end
context
'when there are enqueued and scheduled jobs present'
,
:sidekiq
,
:redis
do
it
'steals from the scheduled sets queue first'
do
Sidekiq
::
Testing
.
disable!
do
expect
(
described_class
).
to
receive
(
:perform
)
.
with
(
'Object'
,
[
1
]).
ordered
expect
(
described_class
).
to
receive
(
:perform
)
.
with
(
'Object'
,
[
2
]).
ordered
BackgroundMigrationWorker
.
perform_async
(
'Object'
,
[
2
])
BackgroundMigrationWorker
.
perform_in
(
10
.
minutes
,
'Object'
,
[
1
])
described_class
.
steal
(
'Object'
)
end
end
end
end
end
describe
'.perform'
do
describe
'.perform'
do
...
...
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