You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DBs not cleaned when using multiple DBs after upgrade to 2.x.x from 1.8.0 #18
10: from /run/media/megatux/6967f1a1-b777-4681-b35f-261f322cd933/code/newsan/newsan_tv_r1/test/test_helper.rb:20:in `<top (required)>'
9: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/2.7.0/forwardable.rb:235:in `clean_with'
8: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/database_cleaner-core-2.0.1/lib/database_cleaner/cleaners.rb:40:in `clean_with'
7: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/database_cleaner-core-2.0.1/lib/database_cleaner/cleaners.rb:40:in `each'
6: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/database_cleaner-core-2.0.1/lib/database_cleaner/cleaners.rb:40:in `block in clean_with'
5: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/database_cleaner-core-2.0.1/lib/database_cleaner/cleaner.rb:65:in `clean_with'
4: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/database_cleaner-active_record-2.0.1/lib/database_cleaner/active_record/truncation.rb:21:in `clean'
3: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/database_cleaner-active_record-2.0.1/lib/database_cleaner/active_record/truncation.rb:33:in `connection'
2: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_handling.rb:283:in `connection'
1: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
/home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:1125:in `retrieve_connection': No connection pool for 'ActiveRecord::Base' found. (ActiveRecord::ConnectionNotEstablished)
10: from /run/media/megatux/6967f1a1-b777-4681-b35f-261f322cd933/code/newsan/newsan_tv_r1/test/test_helper.rb:20:in `<top (required)>'
9: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/2.7.0/forwardable.rb:235:in `clean_with'
8: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/database_cleaner-core-2.0.1/lib/database_cleaner/cleaners.rb:40:in `clean_with'
7: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/database_cleaner-core-2.0.1/lib/database_cleaner/cleaners.rb:40:in `each'
6: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/database_cleaner-core-2.0.1/lib/database_cleaner/cleaners.rb:40:in `block in clean_with'
5: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/database_cleaner-core-2.0.1/lib/database_cleaner/cleaner.rb:65:in `clean_with'
4: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/database_cleaner-active_record-2.0.1/lib/database_cleaner/active_record/truncation.rb:21:in `clean'
3: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/database_cleaner-active_record-2.0.1/lib/database_cleaner/active_record/truncation.rb:33:in `connection'
2: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_handling.rb:283:in `connection'
1: from /home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
/home/megatux/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:1125:in `retrieve_connection': No connection pool for 'ActiveRecord::Base' found. (ActiveRecord::ConnectionNotEstablished)
This looks like a different issue. In my case it is not raising any error...
changed the title [-]DB not cleaned after upgrade to 2.0.2 from 1.x.x[/-][+]DBs not cleaned when using multiple DBs after upgrade to 2.x.x from 1.8.0[/+]on Jul 27, 2022
Then database cleaner is not using DatabaseCleaner::Sequel::Transaction strategy (that should be default for Sequel), but instead of it uses DatabaseCleaner::NullStrategy. So setting strategy manually to transaction fixes the issue..
Activity
megatux commentedon Nov 7, 2021
Same here, stopped working. Pasting trace:
line 20 of test_helper.rb is this:
PetrKaleta commentedon Jun 23, 2022
@etagwerker are you able to reproduce this issue?
[-]Upgrade to 2.0.0[/-][+]DB not cleaned after upgrade to 2.0.2 from 1.x.x[/+]PetrKaleta commentedon Jul 27, 2022
This looks like a different issue. In my case it is not raising any error...
[-]DB not cleaned after upgrade to 2.0.2 from 1.x.x[/-][+]DBs not cleaned when using multiple DBs after upgrade to 2.x.x from 1.8.0[/+]PetrKaleta commentedon Dec 29, 2022
Hello,
I just came back to this issue and tried to debug it. And I've found whats wrong...
When you use following example
Then database cleaner is not using
DatabaseCleaner::Sequel::Transactionstrategy (that should be default for Sequel), but instead of it usesDatabaseCleaner::NullStrategy. So setting strategy manually totransactionfixes the issue..