diff options
author | Andreas Brandl <abrandl@gitlab.com> | 2019-06-27 15:36:00 +0300 |
---|---|---|
committer | Andreas Brandl <abrandl@gitlab.com> | 2019-06-27 15:36:00 +0300 |
commit | 5c4d0dc69be52c7cb2a24ee7fe13c96c621994ea (patch) | |
tree | 4c56437e1671025a52fd9d0e09a0cbc4dca75004 /spec | |
parent | 47089be063b754b3cc76c47bda7d26876889e5de (diff) | |
parent | d092ed178fe490769f60df2e1ce8a667b812fc79 (diff) |
Merge branch 'sh-handle-nil-replication-lag' into 'master'
Fix background migrations failing with unused replication slot
Closes #63666
See merge request gitlab-org/gitlab-ce!30042
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/postgresql/replication_slot_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/postgresql/replication_slot_spec.rb b/spec/models/postgresql/replication_slot_spec.rb index e100af7ddc7..95ae204a8a8 100644 --- a/spec/models/postgresql/replication_slot_spec.rb +++ b/spec/models/postgresql/replication_slot_spec.rb @@ -47,5 +47,13 @@ describe Postgresql::ReplicationSlot, :postgresql do expect(described_class.lag_too_great?).to eq(false) end + + it 'returns false when there is a nil replication lag' do + expect(described_class) + .to receive(:pluck) + .and_return([0.megabytes, nil]) + + expect(described_class.lag_too_great?).to eq(false) + end end end |