Clear all active connections after PostgreSQL failover tests.

This commit is contained in:
Guo Xiang Tan 2017-11-03 09:21:10 +08:00
parent c7d7cb940c
commit af01860a3d
1 changed files with 1 additions and 2 deletions

View File

@ -36,6 +36,7 @@ describe ActiveRecord::ConnectionHandling do
after do after do
postgresql_fallback_handler.setup! postgresql_fallback_handler.setup!
postgresql_fallback_handler.clear_connections
end end
describe "#postgresql_fallback_connection" do describe "#postgresql_fallback_connection" do
@ -118,8 +119,6 @@ describe ActiveRecord::ConnectionHandling do
expect(ActiveRecord::Base.connection_pool.connections.count).to eq(0) expect(ActiveRecord::Base.connection_pool.connections.count).to eq(0)
expect(postgresql_fallback_handler.master_down?).to eq(nil) expect(postgresql_fallback_handler.master_down?).to eq(nil)
skip("Only fails on Travis")
expect(ActiveRecord::Base.connection) expect(ActiveRecord::Base.connection)
.to be_an_instance_of(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) .to be_an_instance_of(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
end end