From 417be323a214a39e9cf65fcb200c80ac52e0e7c4 Mon Sep 17 00:00:00 2001 From: Krzysztof Kotlarek Date: Tue, 29 Oct 2019 18:25:00 +1100 Subject: [PATCH] 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 ``` --- spec/lib/backup_restore/restorer_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/lib/backup_restore/restorer_spec.rb b/spec/lib/backup_restore/restorer_spec.rb index fa928c5f3dd..e49466092fe 100644 --- a/spec/lib/backup_restore/restorer_spec.rb +++ b/spec/lib/backup_restore/restorer_spec.rb @@ -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 }