Permalink
Browse files

Fail test properly if unable to login to Rails Console

Change-Id: I6108196f9c186b1f2cd1c3bcc1935b678e62fbf9
  • Loading branch information...
1 parent 25a39c4 commit 5fb7503fdd44194d27daf220e66d17fa921e7753 Jennifer Hickey committed Feb 25, 2013
Showing with 10 additions and 8 deletions.
  1. +10 −8 lib/harness/console_helper.rb
@@ -4,22 +4,24 @@ module BVT::Harness
module ConsoleHelpers
def init_console(client, app, port = 10000)
+ console = CFConsole.new(client, app)
+ port = console.pick_port!(port)
+ console.open!
+ console.wait_for_start
+ logged_in = false
3.times do
begin
- @console = CFConsole.new(client, app)
- port = @console.pick_port!(port)
- @console.open!
- @console.wait_for_start
- prompt = @console.login
- @console
+ console.login
+ logged_in = true
break
rescue => e
+ puts "Unable to login to console: #{e}. Retrying."
sleep 1
end
end
- @console.should_not be_nil, "rails console connection " +
+ logged_in.should be_true, "rails console connection " +
"cannot be established in 3 times"
- @console
+ console
end
end

0 comments on commit 5fb7503

Please sign in to comment.