subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbu...@apache.org
Subject svn commit: r1482479 - /subversion/trunk/subversion/bindings/swig/ruby/test/windows_util.rb
Date Tue, 14 May 2013 17:31:50 GMT
Author: pburba
Date: Tue May 14 17:31:50 2013
New Revision: 1482479

URL: http://svn.apache.org/r1482479
Log:
* subversion/bindings/swig/ruby/test/windows_util.rb
  (SvnTestUtil.Windows.Svnserve.setup_svnserve): Rescue an Errno::EACCES
   error, sleep, and attempt a few retries in an attempt to avoid a
   spurious failure in the Ruby binding tests on Windows.



Modified:
    subversion/trunk/subversion/bindings/swig/ruby/test/windows_util.rb

Modified: subversion/trunk/subversion/bindings/swig/ruby/test/windows_util.rb
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/test/windows_util.rb?rev=1482479&r1=1482478&r2=1482479&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/test/windows_util.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/test/windows_util.rb Tue May 14 17:31:50
2013
@@ -105,7 +105,28 @@ module SvnTestUtil
               target_path = "#{path}\\#{target}"
               if File.exists?(target_path)
                 found_targets << target
-                FileUtils.cp(target_path, svnserve_dir)
+                retried = 0
+                begin
+                  FileUtils.cp(target_path, svnserve_dir)
+                rescue Errno::EACCES
+                  # On Windows the tests frequently fail spuriously with a
+                  # 'Errno::EACCES: Permission denied - svnserve.exe' error.
+                  # Sleeping for a few seconds avoids this.
+                  #puts "\nFailed to copy"
+                  #puts $!
+                  #puts "'#{target_path}' to"
+                  #puts "'#{svnserve_dir}'"
+                  #puts "Sleeping for 1 sec, then retrying."
+                  if retried > 5
+                    # Give up!
+                    raise
+                  else
+                    # Wait a sec...
+                    sleep(1)
+                    retried += 1
+                    retry
+                  end
+                end
               end
             end
             targets -= found_targets



Mime
View raw message