diff options
author | elijah <elijah@riseup.net> | 2014-12-04 15:16:25 -0800 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2014-12-04 15:16:25 -0800 |
commit | 7ca1a6feb2f881f2a99b624c266f0779d2402ff9 (patch) | |
tree | 43ee2d96ba1281fae3e098dffe55aa1bc0a0e409 /tests/white-box | |
parent | 60bd76583d46fe1c9f39804c7fd892fa9c1745d0 (diff) |
tests - better errors, ensure tmp users are deleted, remove bad 'pass()' call that made tmp_user tests always succeed.
Diffstat (limited to 'tests/white-box')
-rw-r--r-- | tests/white-box/webapp.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/white-box/webapp.rb b/tests/white-box/webapp.rb index d2419ab4..d5d41833 100644 --- a/tests/white-box/webapp.rb +++ b/tests/white-box/webapp.rb @@ -51,7 +51,7 @@ class Webapp < LeapTest if soledad_config && !soledad_config.empty? soledad_server = pick_soledad_server(soledad_config) assert_tmp_user do |user| - assert user_db_exists?(user), "Could not find user db for test user #{user.username}" + assert_user_db_exists(user) command = File.expand_path "../../helpers/soledad_sync.py", __FILE__ soledad_url = "https://#{soledad_server}/user-#{user.id}" assert_run "#{command} #{user.id} #{user.session_token} #{soledad_url}" @@ -87,17 +87,19 @@ class Webapp < LeapTest # returns true if the per-user db created by tapicero exists. # we try three times, and give up after that. # - def user_db_exists?(user) + def assert_user_db_exists(user) + last_body, last_response, last_error = nil 3.times do sleep 0.1 get(couchdb_url("/user-#{user.id}/_design/docs")) do |body, response, error| + last_body, last_response, last_error = body, response, error if response.code.to_i == 200 - return true + return end end sleep 0.2 end - return false + assert false, "Could not find user db for test user #{user.username}\nuuid=#{user.id}\nHTTP #{last_response.code} #{last_error} #{last_body}" end # |