Skip to content

Commit

Permalink
Added fail test for project-tsurugi/tsurugi-issues#525 (delete_cant_c…
Browse files Browse the repository at this point in the history
…ause_phantom_len9)
  • Loading branch information
ban-nobuhiro authored and thawk105 committed Feb 13, 2024
1 parent a743f6e commit 7b42827
Showing 1 changed file with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,53 @@ TEST_F(short_delete_short_search, delete_cant_cause_phantom) { // NOLINT
ASSERT_EQ(Status::OK, leave(s2));
}

TEST_F(short_delete_short_search, delete_cant_cause_phantom_len9) { // NOLINT
// prepare
Storage st{};
ASSERT_EQ(Status::OK, create_storage("", st));

// adjust timing
wait_epoch_update();

Token s{};
ASSERT_EQ(Status::OK, enter(s));
ASSERT_EQ(Status::OK,
tx_begin({s, transaction_options::transaction_type::SHORT}));
ASSERT_EQ(upsert(s, st, "a12345678", ""), Status::OK);
ASSERT_EQ(upsert(s, st, "b12345678", ""), Status::OK);
ASSERT_EQ(upsert(s, st, "c12345678", ""), Status::OK);
ASSERT_EQ(Status::OK, commit(s)); // NOLINT
ASSERT_EQ(Status::OK,
tx_begin({s, transaction_options::transaction_type::SHORT}));
ASSERT_EQ(Status::OK, delete_record(s, st, "c12345678"));
ASSERT_EQ(Status::OK, commit(s)); // NOLINT
wait_epoch_update();

// test

// scan including deleted record (before shirakami GC)
ASSERT_EQ(Status::OK,
tx_begin({s, transaction_options::transaction_type::SHORT}));
ScanHandle hd{};
ASSERT_EQ(Status::OK, open_scan(s, st, "", scan_endpoint::INF, "",
scan_endpoint::INF, hd));
// sleep so much considering gc
wait_epoch_update();
wait_epoch_update();
wait_epoch_update();

std::string vb{};
ASSERT_EQ(Status::OK, read_key_from_scan(s, hd, vb));
ASSERT_EQ(Status::OK, next(s, hd));
ASSERT_EQ(Status::OK, read_key_from_scan(s, hd, vb)); // XXX: fail

Check failure on line 123 in test/concurrency_control/short_tx/delete_scan/short_delete_scan_phantom_test.cpp

View workflow job for this annotation

GitHub Actions / CTest (ubuntu-22.04, tl_cc)

short_delete_short_search.delete_cant_cause_phantom_len9

Expected equality of these values: Status::OK Which is: OK read_key_from_scan(s, hd, vb) Which is: ERR_CC
ASSERT_EQ(Status::WARN_SCAN_LIMIT, next(s, hd));

ASSERT_EQ(Status::OK, commit(s)); // NOLINT

// cleanup
ASSERT_EQ(Status::OK, leave(s));
}

TEST_F(short_delete_short_search, // NOLINT
delete_cant_cause_node_modification) { // NOLINT
// prepare
Expand Down

0 comments on commit 7b42827

Please sign in to comment.