subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1302539 - in /subversion/trunk/subversion/tests/cmdline: svnadmin_tests.py svntest/main.py
Date Mon, 19 Mar 2012 17:00:01 GMT
Author: danielsh
Date: Mon Mar 19 17:00:00 2012
New Revision: 1302539

URL: http://svn.apache.org/viewvc?rev=1302539&view=rev
Log:
Add a regression test for issue #4129.  Currently XFail.

This requires the 'threading' module in the Python tests.  I'm told that "all
Python has threads", but a one-stop-shop knob to disable threading-requiring
tests is provided.

The exception catching in the test is still WIP.  Suggestions welcome.

* subversion/tests/cmdline/svnadmin_tests.py
  (threading): Import.
  (mergeinfo_race): New test.
  (test_list): Run it.

* subversion/tests/cmdline/svntest/main.py
  (is_threaded_python): New.

Modified:
    subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py
    subversion/trunk/subversion/tests/cmdline/svntest/main.py

Modified: subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py?rev=1302539&r1=1302538&r2=1302539&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py Mon Mar 19 17:00:00 2012
@@ -29,6 +29,7 @@ import os
 import re
 import shutil
 import sys
+import threading
 
 # Our testing module
 import svntest
@@ -1780,6 +1781,48 @@ def locking(sbox):
                                           iota_token)
 
 
+@SkipUnless(svntest.main.is_threaded_python)
+@Issue(4129)
+@XFail()
+def mergeinfo_race(sbox):
+  "concurrent mergeinfo commits invalidate pred-count"
+  sbox.build()
+
+  wc_dir = sbox.wc_dir
+  wc2_dir = sbox.add_wc_path('2')
+
+  ## Create wc2.
+  svntest.main.run_svn(None, 'checkout', '-q', sbox.repo_url, wc2_dir)
+
+  ## Some random edits.
+  svntest.main.run_svn(None, 'mkdir', sbox.ospath('d1', wc_dir))
+  svntest.main.run_svn(None, 'mkdir', sbox.ospath('d2', wc2_dir))
+
+  ## Set random mergeinfo properties.
+  svntest.main.run_svn(None, 'ps', 'svn:mergeinfo', '/P:42', sbox.ospath('A', wc_dir))
+  svntest.main.run_svn(None, 'ps', 'svn:mergeinfo', '/Q:42', sbox.ospath('iota', wc2_dir))
+
+  def makethread(some_wc_dir):
+    def worker():
+      svntest.main.run_svn(None, 'commit', '-mm', some_wc_dir)
+    return worker
+
+  t1 = threading.Thread(None, makethread(wc_dir))
+  t2 = threading.Thread(None, makethread(wc2_dir))
+
+  # t2 will trigger the issue #4129 sanity check in fs_fs.c
+  t1.start(); t2.start();
+
+  t1.join(); t2.join();
+
+  # Crude attempt to make sure everything worked.
+  # TODO: better way to catch exceptions in the thread
+  if svntest.actions.run_and_parse_info(sbox.repo_url)[0]['Revision'] != 3:
+    raise svntest.Failure("one or both commits failed")
+
+
+
+
 ########################################################################
 # Run the tests
 
@@ -1814,6 +1857,7 @@ test_list = [ None,
               hotcopy_incremental,
               hotcopy_incremental_packed,
               locking,
+              mergeinfo_race,
              ]
 
 if __name__ == '__main__':

Modified: subversion/trunk/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/main.py?rev=1302539&r1=1302538&r2=1302539&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/main.py Mon Mar 19 17:00:00 2012
@@ -1125,6 +1125,9 @@ def is_os_darwin():
 def is_fs_case_insensitive():
   return (is_os_darwin() or is_os_windows())
 
+def is_threaded_python():
+  return True
+
 def server_has_mergeinfo():
   return options.server_minor_version >= 5
 



Mime
View raw message