Fix non-deterministic user acceptance tests

This commit is contained in:
Thibault Jouan
2015-04-21 13:38:34 +00:00
parent 47bc9c9da2
commit 730527b836
6 changed files with 23 additions and 21 deletions

View File

@@ -64,7 +64,8 @@ module Uh
@other_wm
end
def x_client ident = :default
def x_client ident = nil
ident ||= :default
@x_clients ||= {}
@x_clients[ident] ||= XClient.new(ident)
end
@@ -103,7 +104,7 @@ module Uh
private
def timeout_until
def timeout_until message = 'condition not met after %d seconds'
timeout = ENV.key?('UHWMTEST_TIMEOUT') ?
ENV['UHWMTEST_TIMEOUT'].to_i :
TIMEOUT_DEFAULT
@@ -114,7 +115,7 @@ module Uh
end
end
rescue Timeout::Error
fail TimeoutError.new('execution expired', timeout)
fail TimeoutError.new(message % timeout, timeout)
end