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.
@@ -3873,14 +3873,17 @@ def check_recover_prunes_rep_cache(sbox, enable_rep_sharing):
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,
+ # Add a newline in case the existing file doesn't
+ # end with one.
+ "\n"
"[rep-sharing]\n"
- "enable-rep-sharing = false\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, enable_rep_sharing):
# 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)
