Skip to content
Browse files

Make integration tests more robust against LockedSwitcher issues

  • Loading branch information...
1 parent 5f24ecb commit b072bb72598ce55c4b91f742ede6be0c72c25bde @grobie committed Mar 25, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 spec/integration/integration_helper.rb
View
11 spec/integration/integration_helper.rb
@@ -48,7 +48,16 @@ def select_value(*args)
end
def execute(*args)
- connection.execute(*args)
+ retries = 10
+ begin
+ connection.execute(*args)
+ rescue ActiveRecord::StatementInvalid => e
+ if (retries -= 1) > 0 && e.message =~ /Table '.*?' doesn't exist/
+ retry
+ else
+ raise
+ end
+ end
end
def slave(&block)

0 comments on commit b072bb7

Please sign in to comment.
Something went wrong with that request. Please try again.