From ac97e6930f3443c3bf5a4ce77834bcaa863d2540 Mon Sep 17 00:00:00 2001 From: HouBingjian <54057110+houbingjian@users.noreply.github.com> Date: Thu, 5 Sep 2019 17:01:58 -0700 Subject: [PATCH] bloom test check fail on arm (#5745) Summary: FullFilterBitsBuilder::CalculateSpace use CACHE_LINE_SIZE which is 64@X86 but 128@ARM64 when it run bloom_test.FullVaryingLengths it failed on ARM64 server, the assert can be fixed by change 128->CACHE_LINE_SIZE*2 as merged ASSERT_LE(FilterSize(), (size_t)((length * 10 / 8) + CACHE_LINE_SIZE * 2 + 5)) << length; run bloom_test before fix: /root/rocksdb-master/util/bloom_test.cc:281: Failure Expected: (FilterSize()) <= ((size_t)((length * 10 / 8) + 128 + 5)), actual: 389 vs 383 200 [ FAILED ] FullBloomTest.FullVaryingLengths (32 ms) [----------] 4 tests from FullBloomTest (32 ms total) [----------] Global test environment tear-down [==========] 7 tests from 2 test cases ran. (116 ms total) [ PASSED ] 6 tests. [ FAILED ] 1 test, listed below: [ FAILED ] FullBloomTest.FullVaryingLengths after fix: Filters: 37 good, 0 mediocre [ OK ] FullBloomTest.FullVaryingLengths (90 ms) [----------] 4 tests from FullBloomTest (90 ms total) [----------] Global test environment tear-down [==========] 7 tests from 2 test cases ran. (174 ms total) [ PASSED ] 7 tests. Pull Request resolved: https://github.com/facebook/rocksdb/pull/5745 Differential Revision: D17076047 fbshipit-source-id: e7beb5d55d4855fceb2b84bc8119a6b0759de635 --- util/bloom_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/bloom_test.cc b/util/bloom_test.cc index 5e61f31ba..688920ea0 100644 --- a/util/bloom_test.cc +++ b/util/bloom_test.cc @@ -278,7 +278,7 @@ TEST_F(FullBloomTest, FullVaryingLengths) { } Build(); - ASSERT_LE(FilterSize(), (size_t)((length * 10 / 8) + 128 + 5)) << length; + ASSERT_LE(FilterSize(), (size_t)((length * 10 / 8) + CACHE_LINE_SIZE * 2 + 5)) << length; // All added keys must match for (int i = 0; i < length; i++) {