Skip to content

Commit 7e04d0e

Browse files
committed
Scale timeout in win32ole
1 parent 7ee895e commit 7e04d0e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/win32ole/test_win32ole_event.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,13 @@ def message_loop(watch_ivar = nil)
6565
if watch_ivar
6666
# wait until event is proceeded
6767
tries = 0
68+
seconds = EnvUtil.apply_timeout_scale(1)
6869
while tries < 5 && instance_variable_get(watch_ivar) == orig_ivar
69-
seconds = 2 ** tries # sleep at most 31s in total
7070
$stderr.puts "test_win32ole_event.rb: retrying and sleeping #{seconds}s until #{watch_ivar} is changed from #{orig_ivar.inspect}..."
7171
WIN32OLE_EVENT.message_loop
7272
sleep(seconds)
7373
tries += 1
74+
seconds *= 2 # sleep at most 31s in total
7475
end
7576
end
7677
end

0 commit comments

Comments
 (0)