diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-10 11:58:40 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-10 11:58:40 +0000 |
commit | 1b8534e66ba0be84617db8ab7c3ddf8ab3e957fa (patch) | |
tree | 04be011791e6e21f951be11c57caf7a860839032 /spec | |
parent | 3f113219dfcc412247944fdbb75932cc3cc36891 (diff) | |
download | ruby-1b8534e66ba0be84617db8ab7c3ddf8ab3e957fa.tar.gz |
spec/.../ole_method.rb: retry WIN32OLERuntimeError
This part sometimes causes random failure like:
https://ci.appveyor.com/project/ruby/ruby/builds/19382723/job/bedc33p4nolcqkp6
Let me retry this to make CI stable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec')
-rw-r--r-- | spec/ruby/library/win32ole/win32ole/shared/ole_method.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/ruby/library/win32ole/win32ole/shared/ole_method.rb b/spec/ruby/library/win32ole/win32ole/shared/ole_method.rb index 33268e0aa2..9fdb5f2055 100644 --- a/spec/ruby/library/win32ole/win32ole/shared/ole_method.rb +++ b/spec/ruby/library/win32ole/win32ole/shared/ole_method.rb @@ -5,7 +5,20 @@ platform_is :windows do describe :win32ole_ole_method, shared: true do before :each do - @ie = WIN32OLESpecs.new_ole('InternetExplorer.Application') + # This part is unstable, so retrying 3 times. + tries = 0 + begin + @ie = WIN32OLESpecs.new_ole('InternetExplorer.Application') + rescue WIN32OLERuntimeError => e + # WIN32OLERuntimeError: failed to create WIN32OLE object from `InternetExplorer.Application' + # HRESULT error code:0x800704a6 + # A system shutdown has already been scheduled. + if tries < 3 + tries += 1 + $stderr.puts "win32ole_ole_method retry (#{tries}): #{e.class}: #{e.message}" + retry + end + end end after :each do |