Skip to content

Commit

Permalink
Direct io read is only enabled on linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
toregge committed Nov 24, 2024
1 parent a26e0b9 commit 1a6b9b5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions searchlib/src/tests/diskindex/diskindex/diskindex_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,11 @@ DiskIndexTest::requireThatWeCanReadPostingList(const IOSettings& io_settings)
EXPECT_EQ(SimpleResult({1,3}), search(field_index, r, h));
if (io_settings._use_directio && !io_settings._use_mmap) {
auto directio_handle = field_index.read_uncached_posting_list(r, false);
#ifdef __linux__
EXPECT_LT(256, directio_handle._allocSize);
#else
EXPECT_GT(64, directio_handle._allocSize);
#endif
EXPECT_EQ(SimpleResult({1,3}), search(field_index, r, directio_handle));
auto trimmed_directio_handle = field_index.read_uncached_posting_list(r, true);
EXPECT_GT(64, trimmed_directio_handle._allocSize);
Expand Down

0 comments on commit 1a6b9b5

Please sign in to comment.