diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-04-27 18:53:23 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-04-27 18:53:23 +0200 |
commit | a1b4816759418ca8fe510e8739622fc5d77ab0f0 (patch) | |
tree | 9d4fb6091d0086817f5bde46bf1150e9130d34fd /spec/ruby/library/socket | |
parent | 00c33d9c232ed1a79eda17acd7231ac93caa162b (diff) |
Update to ruby/spec@15c9619
Diffstat (limited to 'spec/ruby/library/socket')
-rw-r--r-- | spec/ruby/library/socket/fixtures/classes.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/ruby/library/socket/fixtures/classes.rb b/spec/ruby/library/socket/fixtures/classes.rb index b73fd0fa4c..4cfa084333 100644 --- a/spec/ruby/library/socket/fixtures/classes.rb +++ b/spec/ruby/library/socket/fixtures/classes.rb @@ -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 |