Ask for Help
“Rails 3 / mysql2 gem: Errors from ActiveRecord due to DB handler going bad while running Cucumber tests. What to do?”
Cucumber does some forking, which may result in your connection being shared in multiple processes, which in turn results in Bad Things©. There may be a way to disable this behavior in the Cucumber rake task. A blunter, less desirable solution may be changing ActiveRecord to reconnect more frequently.
Put an error handler on document. You could make an AJAX request back to your server from there to send debugging information. Alternatively, making an AJAX request at the time of your error may not be safe, so you can also put a request in the source tag of an image or script tag, and this may be more reliable.