Skip to content

Commit

Permalink
test: fix cases that depend on timing
Browse files Browse the repository at this point in the history
  • Loading branch information
kuron99 committed Oct 29, 2024
1 parent 2e13450 commit 51e8e3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions shirakami/test/ApiTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1936,9 +1936,8 @@ TEST_F(ShirakamiApiTest, precommit_callback_ltx) {
called0 = true;
ASSERT_EQ(StatusCode::OK, st);
}));
EXPECT_TRUE(called0);
EXPECT_EQ(2, p.use_count());
wait_epochs(5);
EXPECT_TRUE(called0);
EXPECT_TRUE(called1);
EXPECT_EQ(1, p.use_count());
EXPECT_LT(tx_durable_mark, durability_marker);
Expand Down
3 changes: 2 additions & 1 deletion shirakami/test/TransactionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ TEST_F(ShirakamiTransactionTest, check_tx_status) {
ASSERT_EQ(TransactionState::StateKind::STARTED, s.state_kind());
ASSERT_EQ(tx->commit(), StatusCode::OK);
s = tx->check_state();
ASSERT_EQ(TransactionState::StateKind::WAITING_DURABLE, s.state_kind());
// commenting out since WAITING_DURABLE is not guaranteed to be observed
// ASSERT_EQ(TransactionState::StateKind::WAITING_DURABLE, s.state_kind());
while(tx->check_state().state_kind() == TransactionState::StateKind::WAITING_DURABLE) {
std::this_thread::sleep_for(1ms);
}
Expand Down

0 comments on commit 51e8e3c

Please sign in to comment.