You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2013/12/18 20:13:38 UTC

svn commit: r1552064 - /subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py

Author: rhuijben
Date: Wed Dec 18 19:13:38 2013
New Revision: 1552064

URL: http://svn.apache.org/r1552064
Log:
Stop rewriting the shared 'authz' file on every creation of a sandbox in our
testsuite when running the tests parallel.

Rewriting a shared file is just not an option when running the tests in
parallel even when you do this 'atomically' you lock the path for some time
on Windows, so you get test failures.

The main.py code explicitly documents this, but somehow this code got
duplicated here without any of the warnings.

This fixes running the httpd tests in parallel on Windows.

* subversion/tests/cmdline/svntest/sandbox.py
  (_set_name): Stay away from the authz file when running the tests parallel.

Modified:
    subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py

Modified: subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py?rev=1552064&r1=1552063&r2=1552064&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py Wed Dec 18 19:13:38 2013
@@ -72,11 +72,14 @@ class Sandbox:
       if not os.path.exists(svntest.main.work_dir):
         os.makedirs(svntest.main.work_dir)
       self.authz_file = os.path.join(svntest.main.work_dir, "authz")
-      tmp_authz_file = os.path.join(svntest.main.work_dir, "authz-" + self.name)
-      open(tmp_authz_file, 'w').write("[/]\n* = rw\n")
-      shutil.move(tmp_authz_file, self.authz_file)
       self.groups_file = os.path.join(svntest.main.work_dir, "groups")
 
+      if svntest.main.options.parallel == 0:
+        # Never, ever do this when running the tests in parallel.
+        tmp_authz_file = os.path.join(svntest.main.work_dir, "authz-" + self.name)
+        open(tmp_authz_file, 'w').write("[/]\n* = rw\n")
+        shutil.move(tmp_authz_file, self.authz_file)
+
     # For svnserve tests we have a per-repository authz file, and it
     # doesn't need to be there in order for things to work, so we don't
     # have any default contents.