You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ko...@apache.org on 2017/08/23 14:04:03 UTC

svn commit: r1805896 - /subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-private-test.c

Author: kotkov
Date: Wed Aug 23 14:04:02 2017
New Revision: 1805896

URL: http://svn.apache.org/viewvc?rev=1805896&view=rev
Log:
Make the fsfs stats test work properly with LZ4 compression.

One of the expectations has been that for our test Greek Tree repository,
the on-disk size of the directory representations should be _more_ than
their actual size (due to the overheads associated with serializing them
on the disk).

This assumption is quite sensitive to the used compression algorithm.
For example, the actual size of the directory representations is 618 bytes.
Assuming directory deltification is enabled, with zlib compression the size
is 708 bytes (more than actual), but with LZ4 compression it's 571 bytes,
and that is less than the actual size.  While I think that such result can
be explained just by the fact that the compression algorithms are just
different, the test should take that into account.

* subversion/tests/libsvn_fs_fs/fs-fs-private-test.c
  (verify_representation_stats): Expect sane relation between the packed
   and the actual sizes, but don't assume that the packed size will
   _always_ exceed the actual size.

Modified:
    subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-private-test.c

Modified: subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-private-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-private-test.c?rev=1805896&r1=1805895&r2=1805896&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-private-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_fs_fs/fs-fs-private-test.c Wed Aug 23 14:04:02 2017
@@ -85,8 +85,10 @@ verify_representation_stats(const svn_fs
   SVN_TEST_ASSERT(stats->total.count == expected_count);
   SVN_TEST_ASSERT(   stats->total.packed_size >= 10 * expected_count
                   && stats->total.packed_size <= 1000 * expected_count);
-  SVN_TEST_ASSERT(   stats->total.packed_size >= stats->total.expanded_size
-                  && stats->total.packed_size <= 2 * stats->total.expanded_size);
+  /* Expect the packed size to be sane, keeping in mind that it might
+   * be less or more than the expanded size due differences in the
+   * compression algorithms or options such as directory deltification. */
+  SVN_TEST_ASSERT(stats->total.packed_size <= 2 * stats->total.expanded_size);
   SVN_TEST_ASSERT(   stats->total.overhead_size >= 5 * expected_count
                   && stats->total.overhead_size <= 100 * expected_count);