summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2019-07-23 15:00:11 +0000
committerRobert Speicher <rspeicher@gmail.com>2019-07-23 15:00:11 +0000
commitd892e80bf0161b535389c91ccb53539e4f08d790 (patch)
treef5d2577f457d3320d305e5e40033848e5b783af1 /spec
parent2eda97befe1ce32968040cf2a2b7d87611c0f091 (diff)
parentab11eee1d6e3881399b671f0ebe857a085321371 (diff)
downloadgitlab-ce-d892e80bf0161b535389c91ccb53539e4f08d790.tar.gz
Merge branch 'bvl-mark-remote-mirrors-as-failed-sooner' into 'master'
Mark mirrors as failed 1 hour after they started See merge request gitlab-org/gitlab-ce!30999
Diffstat (limited to 'spec')
-rw-r--r--spec/models/remote_mirror_spec.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/spec/models/remote_mirror_spec.rb b/spec/models/remote_mirror_spec.rb
index e14b19db915..687b0935c55 100644
--- a/spec/models/remote_mirror_spec.rb
+++ b/spec/models/remote_mirror_spec.rb
@@ -113,7 +113,7 @@ describe RemoteMirror, :mailer do
remote_mirror = create(:remote_mirror)
- expect(remote_mirror.remote_name).to eq("remote_mirror_secret")
+ expect(remote_mirror.remote_name).to eq('remote_mirror_secret')
end
end
@@ -201,11 +201,20 @@ describe RemoteMirror, :mailer do
end
context 'stuck mirrors' do
- it 'includes mirrors stuck in started with no last_update_at set' do
+ it 'includes mirrors that were started over an hour ago' do
+ mirror = create_mirror(url: 'http://cantbeblank',
+ update_status: 'started',
+ last_update_at: 3.hours.ago,
+ updated_at: 2.hours.ago)
+
+ expect(described_class.stuck.last).to eq(mirror)
+ end
+
+ it 'includes mirrors started over 3 hours ago for their first sync' do
mirror = create_mirror(url: 'http://cantbeblank',
update_status: 'started',
last_update_at: nil,
- updated_at: 25.hours.ago)
+ updated_at: 4.hours.ago)
expect(described_class.stuck.last).to eq(mirror)
end