DEV: More attempts at stablizing specs in Travis.
Re-enable skipped test because it doesn't fail locally for me to debug it.
This commit is contained in:
parent
f33433bf9e
commit
ecf60c0c33
|
@ -40,14 +40,7 @@ describe ActiveRecord::ConnectionHandling do
|
||||||
postgresql_fallback_handler.setup!
|
postgresql_fallback_handler.setup!
|
||||||
Discourse.disable_readonly_mode(Discourse::PG_READONLY_MODE_KEY)
|
Discourse.disable_readonly_mode(Discourse::PG_READONLY_MODE_KEY)
|
||||||
ActiveRecord::Base.unstub(:postgresql_connection)
|
ActiveRecord::Base.unstub(:postgresql_connection)
|
||||||
|
(Thread.list - @threads).each(&:kill)
|
||||||
(Thread.list - @threads).each do |thread|
|
|
||||||
unless thread.join(5)
|
|
||||||
puts Thread.list - @threads
|
|
||||||
raise "Threads still running"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
ActiveRecord::Base.establish_connection
|
ActiveRecord::Base.establish_connection
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -80,11 +73,6 @@ describe ActiveRecord::ConnectionHandling do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should failover to a replica server' do
|
it 'should failover to a replica server' do
|
||||||
# erratically fails with: ActiveRecord::ConnectionTimeoutError:
|
|
||||||
# could not obtain a connection from the pool within 5.000 seconds (waited 5.000 seconds); all pooled connections were in use
|
|
||||||
#
|
|
||||||
skip("This test is failing erratically")
|
|
||||||
|
|
||||||
RailsMultisite::ConnectionManagement.stubs(:all_dbs).returns(['default', multisite_db])
|
RailsMultisite::ConnectionManagement.stubs(:all_dbs).returns(['default', multisite_db])
|
||||||
postgresql_fallback_handler.expects(:verify_master).at_least(3)
|
postgresql_fallback_handler.expects(:verify_master).at_least(3)
|
||||||
|
|
||||||
|
@ -178,8 +166,11 @@ describe ActiveRecord::ConnectionHandling do
|
||||||
end
|
end
|
||||||
|
|
||||||
def with_multisite_db(dbname)
|
def with_multisite_db(dbname)
|
||||||
|
begin
|
||||||
RailsMultisite::ConnectionManagement.expects(:current_db).returns(dbname).at_least_once
|
RailsMultisite::ConnectionManagement.expects(:current_db).returns(dbname).at_least_once
|
||||||
yield
|
yield
|
||||||
|
ensure
|
||||||
RailsMultisite::ConnectionManagement.unstub(:current_db)
|
RailsMultisite::ConnectionManagement.unstub(:current_db)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue