diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-11-21 18:11:33 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-11-25 23:53:15 +0900 |
commit | 270c48507dbb1553cd09b92e5b7c542f95ffc68e (patch) | |
tree | 76332a56a6224e5103284c1072bfd73d8cb8317c /test/win32ole | |
parent | ae9593978468b9d65892626bc72edad780c5bf88 (diff) |
[ruby/win32ole] Scale timeout in win32ole
https://github.com/ruby/win32ole/commit/7e04d0eb3e
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5175
Diffstat (limited to 'test/win32ole')
-rw-r--r-- | test/win32ole/test_win32ole_event.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/win32ole/test_win32ole_event.rb b/test/win32ole/test_win32ole_event.rb index 742bff4f7a..fa9e7b5b08 100644 --- a/test/win32ole/test_win32ole_event.rb +++ b/test/win32ole/test_win32ole_event.rb @@ -65,12 +65,13 @@ if defined?(WIN32OLE_EVENT) if watch_ivar # wait until event is proceeded tries = 0 + seconds = EnvUtil.apply_timeout_scale(1) while tries < 5 && instance_variable_get(watch_ivar) == orig_ivar - seconds = 2 ** tries # sleep at most 31s in total $stderr.puts "test_win32ole_event.rb: retrying and sleeping #{seconds}s until #{watch_ivar} is changed from #{orig_ivar.inspect}..." WIN32OLE_EVENT.message_loop sleep(seconds) tries += 1 + seconds *= 2 # sleep at most 31s in total end end end |