title: Cucumber and RSpec testing with zeus: Postgres is being accessed by other users
body: <p>In my Rails 3.2.13 app, I'm using Zeus. In the test environment I use PostgreSQL. When I run Cucumber and then RSpec (or the other way around), 9 out of 10 times I get the message:</p>
  
  <pre><code>PG::Error: ERROR:  database "bp_test" is being accessed by other users
  DETAIL:  There are 1 other session(s) using the database.
  : DROP DATABASE IF EXISTS "bp_test"
  
  Tasks: TOP =&gt; db:test:load =&gt; db:test:purge
  (See full trace by running task with --trace)
  </code></pre>
  
  <p>It takes a whole non-deterministic circus of trying to kill database connections to get this to work again, as described <a href="https://stackoverflow.com/a/5750734/414376">here</a>. But this does not always work and is a big hassle as well. There must be a better solution for this. Does anyone know?</p>