Increase range for GeneralTableTest.ApproximateOffsetOfCompressed (#8387)

Summary:
Newer versions of Snappy (1.1 patch 8) were failing this test because the offsets were outside of the expected range.

In some experiments:
- On a RH machine with 1.1.0, the offset of "k04" and "xyy" were 3331 and 6665.
- On an Ubuntu machine with 1.1.8, the same keys were at 3501 and 7004.
- On a Mac with 1.1.8, the offsets were 3499 and 7001.

AFAICT, the test environments are either using an older version of Snappy or no Snappy at all.

This change increases the range to allow the tests to pass.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/8387

Reviewed By: pdillinger

Differential Revision: D29064475

Pulled By: mrambacher

fbshipit-source-id: fac01927576765b8aff9f57e08a63a2ae210855f
This commit is contained in:
mrambacher 2021-06-15 03:43:34 -07:00 committed by Facebook GitHub Bot
parent 281ac9c89e
commit b788e3f497

View File

@ -3579,9 +3579,9 @@ static void DoCompressionTest(CompressionType comp) {
ASSERT_TRUE(Between(c.ApproximateOffsetOf("abc"), 0, 0));
ASSERT_TRUE(Between(c.ApproximateOffsetOf("k01"), 0, 0));
ASSERT_TRUE(Between(c.ApproximateOffsetOf("k02"), 0, 0));
ASSERT_TRUE(Between(c.ApproximateOffsetOf("k03"), 2000, 3500));
ASSERT_TRUE(Between(c.ApproximateOffsetOf("k04"), 2000, 3500));
ASSERT_TRUE(Between(c.ApproximateOffsetOf("xyz"), 4000, 7000));
ASSERT_TRUE(Between(c.ApproximateOffsetOf("k03"), 2000, 3525));
ASSERT_TRUE(Between(c.ApproximateOffsetOf("k04"), 2000, 3525));
ASSERT_TRUE(Between(c.ApproximateOffsetOf("xyz"), 4000, 7050));
c.ResetTableReader();
}