Skip to content

Commit

Permalink
[test](cloud) Reduce testing duration when there is no fdb available (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinchou authored Apr 21, 2024
1 parent 06c9fb6 commit eaf0157
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cloud/test/fdb_injection_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ int main(int argc, char** argv) {
cloud::config::txn_store_retry_base_intervals_ms = 1;
cloud::config::fdb_cluster_file_path = "fdb.cluster";
cloud::config::write_schema_kv = true;
// UT may be run without fdb, it will take unnecessary time with the default value
cloud::config::fdb_txn_timeout_ms = 500;

auto sp = cloud::SyncPoint::get_instance();
sp->enable_processing();
Expand Down
2 changes: 2 additions & 0 deletions cloud/test/mem_txn_kv_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ std::shared_ptr<cloud::TxnKv> fdb_txn_kv;
int main(int argc, char** argv) {
cloud::config::init(nullptr, true);
cloud::config::fdb_cluster_file_path = "fdb.cluster";
// UT may be run without fdb, it will take unnecessary time with the default value
cloud::config::fdb_txn_timeout_ms = 500;
fdb_txn_kv = std::dynamic_pointer_cast<cloud::TxnKv>(std::make_shared<cloud::FdbTxnKv>());
if (!fdb_txn_kv.get()) {
std::cout << "exit get FdbTxnKv error" << std::endl;
Expand Down
2 changes: 2 additions & 0 deletions cloud/test/txn_kv_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ std::shared_ptr<TxnKv> txn_kv;

void init_txn_kv() {
config::fdb_cluster_file_path = "fdb.cluster";
// UT may be run without fdb, it will take unnecessary time with the default value
config::fdb_txn_timeout_ms = 500;
txn_kv = std::dynamic_pointer_cast<TxnKv>(std::make_shared<FdbTxnKv>());
ASSERT_NE(txn_kv.get(), nullptr);
int ret = txn_kv->init();
Expand Down

0 comments on commit eaf0157

Please sign in to comment.