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

ruby-changes:53174

From: k0kubun <ko1@a...>
Date: Sat, 27 Oct 2018 19:50:03 +0900 (JST)
Subject: [ruby-changes:53174] k0kubun:r65389 (trunk): ole_func_methods_spec.rb: apply r64993 retry

k0kubun	2018-10-27 19:49:56 +0900 (Sat, 27 Oct 2018)

  New Revision: 65389

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65389

  Log:
    ole_func_methods_spec.rb: apply r64993 retry
    
    to this spec as well, since the same issue was reproduced here
    https://ci.appveyor.com/project/ruby/ruby/builds/19842006/job/y35ae6bquf4t3x30

  Modified files:
    trunk/spec/ruby/library/win32ole/win32ole/ole_func_methods_spec.rb
Index: spec/ruby/library/win32ole/win32ole/ole_func_methods_spec.rb
===================================================================
--- spec/ruby/library/win32ole/win32ole/ole_func_methods_spec.rb	(revision 65388)
+++ spec/ruby/library/win32ole/win32ole/ole_func_methods_spec.rb	(revision 65389)
@@ -5,7 +5,20 @@ platform_is :windows do https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/win32ole/win32ole/ole_func_methods_spec.rb#L5
 
   describe "WIN32OLE#ole_func_methods" 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_func_methods retry (#{tries}): #{e.class}: #{e.message}"
+          retry
+        end
+      end
     end
 
     after :each do

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

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