mirror of
https://github.com/apple/foundationdb.git
synced 2025-06-02 19:25:52 +08:00
Remove unit tests dependent on knob
This commit is contained in:
parent
c93052121f
commit
fc2bfdbacf
@ -1962,40 +1962,40 @@ TEST_CASE("special-key-space set transaction ID after write") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("special-key-space set token after write") {
|
// TEST_CASE("special-key-space set token after write") {
|
||||||
fdb::Transaction tr(db);
|
// fdb::Transaction tr(db);
|
||||||
fdb_check(tr.set_option(FDB_TR_OPTION_SPECIAL_KEY_SPACE_ENABLE_WRITES, nullptr, 0));
|
// fdb_check(tr.set_option(FDB_TR_OPTION_SPECIAL_KEY_SPACE_ENABLE_WRITES, nullptr, 0));
|
||||||
while (1) {
|
// while (1) {
|
||||||
tr.set(key("foo"), "bar");
|
// tr.set(key("foo"), "bar");
|
||||||
tr.set("\xff\xff/tracing/token", "false");
|
// tr.set("\xff\xff/tracing/token", "false");
|
||||||
fdb::ValueFuture f1 = tr.get("\xff\xff/tracing/token",
|
// fdb::ValueFuture f1 = tr.get("\xff\xff/tracing/token",
|
||||||
/* snapshot */ false);
|
// /* snapshot */ false);
|
||||||
|
//
|
||||||
|
// fdb_error_t err = wait_future(f1);
|
||||||
|
// if (err) {
|
||||||
|
// fdb::EmptyFuture f2 = tr.on_error(err);
|
||||||
|
// fdb_check(wait_future(f2));
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// int out_present;
|
||||||
|
// char* val;
|
||||||
|
// int vallen;
|
||||||
|
// fdb_check(f1.get(&out_present, (const uint8_t**)&val, &vallen));
|
||||||
|
//
|
||||||
|
// REQUIRE(out_present);
|
||||||
|
// uint64_t token = std::stoul(std::string(val, vallen));
|
||||||
|
// CHECK(token != 0);
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
fdb_error_t err = wait_future(f1);
|
// TEST_CASE("special-key-space valid token") {
|
||||||
if (err) {
|
// auto value = get_value("\xff\xff/tracing/token", /* snapshot */ false, {});
|
||||||
fdb::EmptyFuture f2 = tr.on_error(err);
|
// REQUIRE(value.has_value());
|
||||||
fdb_check(wait_future(f2));
|
// uint64_t token = std::stoul(value.value());
|
||||||
continue;
|
// CHECK(token > 0);
|
||||||
}
|
// }
|
||||||
|
|
||||||
int out_present;
|
|
||||||
char* val;
|
|
||||||
int vallen;
|
|
||||||
fdb_check(f1.get(&out_present, (const uint8_t**)&val, &vallen));
|
|
||||||
|
|
||||||
REQUIRE(out_present);
|
|
||||||
uint64_t token = std::stoul(std::string(val, vallen));
|
|
||||||
CHECK(token != 0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_CASE("special-key-space valid token") {
|
|
||||||
auto value = get_value("\xff\xff/tracing/token", /* snapshot */ false, {});
|
|
||||||
REQUIRE(value.has_value());
|
|
||||||
uint64_t token = std::stoul(value.value());
|
|
||||||
CHECK(token > 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_CASE("special-key-space disable tracing") {
|
TEST_CASE("special-key-space disable tracing") {
|
||||||
fdb::Transaction tr(db);
|
fdb::Transaction tr(db);
|
||||||
@ -2099,7 +2099,7 @@ TEST_CASE("special-key-space tracing get range") {
|
|||||||
CHECK(out_count == 2);
|
CHECK(out_count == 2);
|
||||||
|
|
||||||
CHECK(std::string((char*)out_kv[0].key, out_kv[0].key_length) == tracingBegin + "token");
|
CHECK(std::string((char*)out_kv[0].key, out_kv[0].key_length) == tracingBegin + "token");
|
||||||
CHECK(std::stoul(std::string((char*)out_kv[0].value, out_kv[0].value_length)) > 0);
|
// CHECK(std::stoul(std::string((char*)out_kv[0].value, out_kv[0].value_length)) > 0);
|
||||||
CHECK(std::string((char*)out_kv[1].key, out_kv[1].key_length) == tracingBegin + "transaction_id");
|
CHECK(std::string((char*)out_kv[1].key, out_kv[1].key_length) == tracingBegin + "transaction_id");
|
||||||
CHECK(std::stoul(std::string((char*)out_kv[1].value, out_kv[1].value_length)) > 0);
|
CHECK(std::stoul(std::string((char*)out_kv[1].value, out_kv[1].value_length)) > 0);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user