You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2018/09/28 16:14:15 UTC

svn commit: r1842264 - /subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py

Author: danielsh
Date: Fri Sep 28 16:14:15 2018
New Revision: 1842264

URL: http://svn.apache.org/viewvc?rev=1842264&view=rev
Log:
Follow-up to r1838813.

* subversion/tests/cmdline/svnadmin_tests.py
  (check_recover_prunes_rep_cache): 
    Don't use AssertionError to signal test failure.
    Set fsfs.conf enable-rep-sharing in all cases.
    Guard against fsfs.conf not having a final newline.
    Verify the result of 'recover', which the remainder of the test depends on.

Modified:
    subversion/trunk/subversion/tests/cmdline/svnadmin_tests.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=1842264&r1=1842263&r2=1842264&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py Fri Sep 28 16:14:15 2018
@@ -3873,14 +3873,17 @@ def check_recover_prunes_rep_cache(sbox,
   sbox.simple_append('iota', 'New line.\n')
   sbox.simple_commit()
   rep_cache_r2 = read_rep_cache(sbox.repo_dir)
-  assert len(rep_cache_r2) == len(rep_cache_r1) + 1
+  if not (len(rep_cache_r2) == len(rep_cache_r1) + 1):
+    raise svntest.Failure
 
-  # To test 'recover' while rep-sharing is disabled, disable it now.
-  if not enable_rep_sharing:
-    fsfs_conf = svntest.main.get_fsfs_conf_file_path(sbox.repo_dir)
-    svntest.main.file_append(fsfs_conf,
-                             "[rep-sharing]\n"
-                             "enable-rep-sharing = false\n")
+  fsfs_conf = svntest.main.get_fsfs_conf_file_path(sbox.repo_dir)
+  svntest.main.file_append(fsfs_conf,
+                           # Add a newline in case the existing file doesn't
+                           # end with one.
+                           "\n"
+                           "[rep-sharing]\n"
+                           "enable-rep-sharing = %s\n"
+                           % (('true' if enable_rep_sharing else 'false'),))
 
   # Break r2 in such a way that 'recover' will discard it
   head_rev_path = fsfs_file(sbox.repo_dir, 'revs', '2')
@@ -3891,10 +3894,13 @@ def check_recover_prunes_rep_cache(sbox,
   # Recover back to r1.
   svntest.actions.run_and_verify_svnadmin(None, [],
                                           "recover", sbox.repo_dir)
+  svntest.actions.run_and_verify_svnlook(['1\n'], [], 'youngest',
+                                         sbox.repo_dir)
 
   # Check the rep-cache is pruned.
   rep_cache_recovered = read_rep_cache(sbox.repo_dir)
-  assert rep_cache_recovered == rep_cache_r1
+  if not (rep_cache_recovered == rep_cache_r1):
+    raise svntest.Failure
 
 @Issue(4077)
 @SkipUnless(svntest.main.is_fs_type_fsfs)