mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Reset state of DiscourseRedis::FallbackHandler in tests.
This commit is contained in:
@@ -64,6 +64,13 @@ class DiscourseRedis
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Used for testing
|
||||||
|
def reset!
|
||||||
|
@master = true
|
||||||
|
@last_checked = nil
|
||||||
|
@running = false
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def synchronize
|
def synchronize
|
||||||
|
|||||||
@@ -78,6 +78,10 @@ describe DiscourseRedis do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe DiscourseRedis::FallbackHandler do
|
describe DiscourseRedis::FallbackHandler do
|
||||||
|
after do
|
||||||
|
fallback_handler.reset!
|
||||||
|
end
|
||||||
|
|
||||||
describe '#initiate_fallback_to_master' do
|
describe '#initiate_fallback_to_master' do
|
||||||
it 'should fallback to the master server once it is up' do
|
it 'should fallback to the master server once it is up' do
|
||||||
begin
|
begin
|
||||||
|
|||||||
Reference in New Issue
Block a user