Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

PIVOTAL LABS
SF Standup 9/16/2011: Schrodinger's Cucumber

Ask for Help

“I have a fresh install of Rails 3.1 and when I run specs with rake (with the development server running) it complains that the database is already in use.”

A chorus of replies: “I hate it when it says that.”

Looks like the test suite is trying to use the development DB. Try:

RAILS_ENV=test rake ...

It was pointed out that a call to rake that does not explicitly specify RAILS_ENV typically runs in development mode, detects that tests are being run, then switches to test mode. Any code that runs before the environment switch (in initializers, say) will run against the development DB.

“I have a large inherited cucumber suite that consistently fails on CI…. unless I screen share in and watch it. Why do I need to peek for my tests to pass?”

The likely answer: The very act of screen-sharing causes the test-suite to slow down. Use the setSpeed method in Selenium to force Selenium to take a breather between commands (the passed in value is in milliseconds).

Interesting Things

  • resque [ˈrɛsk] + JSON [jāsʌn] = surprise

    Ruby objects queued and dequeued by resque suffer a translation through JSON. What you put in may not be what you get out!

Comments
Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *