mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@15c9619
This commit is contained in:
parent
00c33d9c23
commit
a1b4816759
193 changed files with 3026 additions and 3387 deletions
|
@ -71,12 +71,12 @@ module SocketSpecs
|
|||
end
|
||||
end
|
||||
|
||||
def self.loop_with_timeout(timeout = 5)
|
||||
def self.loop_with_timeout(timeout = TIME_TOLERANCE)
|
||||
require 'timeout'
|
||||
time = Time.now
|
||||
time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
||||
|
||||
loop do
|
||||
if Time.now - time >= timeout
|
||||
if Process.clock_gettime(Process::CLOCK_MONOTONIC) - time >= timeout
|
||||
raise TimeoutError, "Did not succeed within #{timeout} seconds"
|
||||
end
|
||||
|
||||
|
@ -85,7 +85,7 @@ module SocketSpecs
|
|||
end
|
||||
end
|
||||
|
||||
def self.wait_until_success(timeout = 5)
|
||||
def self.wait_until_success(timeout = TIME_TOLERANCE)
|
||||
loop_with_timeout(timeout) do
|
||||
begin
|
||||
return yield
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue