[前][次][番号順一覧][スレッド一覧]

ruby-changes:69936

From: Nobuyoshi <ko1@a...>
Date: Thu, 25 Nov 2021 23:56:18 +0900 (JST)
Subject: [ruby-changes:69936] 270c48507d (master): [ruby/win32ole] Scale timeout in win32ole

https://git.ruby-lang.org/ruby.git/commit/?id=270c48507d

From 270c48507dbb1553cd09b92e5b7c542f95ffc68e Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 21 Nov 2021 18:11:33 +0900
Subject: [ruby/win32ole] Scale timeout in win32ole

https://github.com/ruby/win32ole/commit/7e04d0eb3e
---
 test/win32ole/test_win32ole_event.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/win32ole/test_win32ole_event.rb b/test/win32ole/test_win32ole_event.rb
index 742bff4f7a5..fa9e7b5b080 100644
--- a/test/win32ole/test_win32ole_event.rb
+++ b/test/win32ole/test_win32ole_event.rb
@@ -65,12 +65,13 @@ if defined?(WIN32OLE_EVENT) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_event.rb#L65
         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
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]