diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100755
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -105,6 +105,11 @@ RSpec.configure do |config|
     end
     $saved_indirection_state = nil
 
+    # Some tests can cause us to connect, in which case the lingering
+    # connection is a resource that can cause unexpected failure in later
+    # tests, as well as sharing state accidentally.
+    Puppet.features.rails? and ActiveRecord::Base.remove_connection
+
     # This will perform a GC between tests, but only if actually required.  We
     # experimented with forcing a GC run, and that was less efficient than
     # just letting it run all the time.
(#<I>) Disconnect any ActiveRecord connection after every test.

Some of our tests can trigger an actual ActiveRecord connection being made.
This could leak between tests, potentially causing odd problems, or otherwise
share state between them.

We should, when we have the feature available, ensure we disconnect between
every test, so that we don't share state.