Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix read_io in dataservice test. #568

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class HomestoreConan(ConanFile):
name = "homestore"
version = "6.4.64"
version = "6.4.65"

homepage = "https://github.com/eBay/Homestore"
description = "HomeStore Storage Engine"
Expand Down
5 changes: 3 additions & 2 deletions src/tests/test_data_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ class BlkDataServiceTest : public testing::Test {
void read_io(uint32_t io_size) {
auto remaining_io_size = io_size;
while (remaining_io_size > 0) {
auto const bid = get_rand_blkid_to_read(io_size);
auto const bid = get_rand_blkid_to_read(remaining_io_size);
if (!bid.is_valid()) {
// didn't find any block to read, either write blk map is empty or
// all blks are pending on free.
Expand All @@ -456,6 +456,7 @@ class BlkDataServiceTest : public testing::Test {
// every piece in bid is a single block, e.g. nblks = 1
auto const nbids = bid.num_pieces();
auto sub_io_size = nbids * inst().get_blk_size();
HS_REL_ASSERT_LE(sub_io_size, remaining_io_size, "not expecting sub_io_size to exceed remaining_io_size");

// we pass crc from lambda becaues if there is any async_free_blk, the written blks in the blkcrc map will
// be removed by the time read thenVlue is called;
Expand Down Expand Up @@ -582,7 +583,7 @@ class BlkDataServiceTest : public testing::Test {
auto nbids = io_size / inst().get_blk_size(); // number of blks to read;

// nbids should not exceed max pieces that MultiBlkId can hold;
nbids = std::max(nbids, MultiBlkId::max_addln_pieces);
nbids = std::min(nbids, MultiBlkId::max_addln_pieces);

// make sure skip + nbids are in the range of m_blk_crc_map;
if (skip_nbids + nbids > m_blk_crc_map.size()) { skip_nbids = m_blk_crc_map.size() - nbids; }
Expand Down
Loading