FIX: flaky jobs_base_spec.rb (#8258)

I was searching for a reason for randomly failing jobs_base_spec.rb. The reason was that after restorer_spec, the database is not restored to default.
After restorer spec RailsMultisite::ConnectionManagement.all_dbs is returning array of ['default', 'second']

Then base job execution is evaluated twice
```
dbs = RailsMultisite::ConnectionManagement.all_dbs
dbs.each do |db|
     execute(opts)
end
```
This commit is contained in:
Krzysztof Kotlarek 2019-10-29 18:25:00 +11:00 committed by Sam
parent 492742837e
commit 417be323a2
1 changed files with 1 additions and 0 deletions

View File

@ -110,6 +110,7 @@ describe BackupRestore::Restorer do
described_class.any_instance.stubs(initialize_state: true)
end
after do
RailsMultisite::ConnectionManagement.clear_settings!
conn.establish_connection(db: 'default')
end
let(:conn) { RailsMultisite::ConnectionManagement }