Remove unit tests dependent on knob

This commit is contained in:
Lukas Joswiak 2021-11-04 10:40:03 -07:00
parent c93052121f
commit fc2bfdbacf

View File

@ -1962,40 +1962,40 @@ TEST_CASE("special-key-space set transaction ID after write") {
}
}
TEST_CASE("special-key-space set token after write") {
fdb::Transaction tr(db);
fdb_check(tr.set_option(FDB_TR_OPTION_SPECIAL_KEY_SPACE_ENABLE_WRITES, nullptr, 0));
while (1) {
tr.set(key("foo"), "bar");
tr.set("\xff\xff/tracing/token", "false");
fdb::ValueFuture f1 = tr.get("\xff\xff/tracing/token",
/* snapshot */ false);
// TEST_CASE("special-key-space set token after write") {
// fdb::Transaction tr(db);
// fdb_check(tr.set_option(FDB_TR_OPTION_SPECIAL_KEY_SPACE_ENABLE_WRITES, nullptr, 0));
// while (1) {
// tr.set(key("foo"), "bar");
// tr.set("\xff\xff/tracing/token", "false");
// fdb::ValueFuture f1 = tr.get("\xff\xff/tracing/token",
// /* 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);
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;
}
}
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 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") {
fdb::Transaction tr(db);
@ -2099,7 +2099,7 @@ TEST_CASE("special-key-space tracing get range") {
CHECK(out_count == 2);
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::stoul(std::string((char*)out_kv[1].value, out_kv[1].value_length)) > 0);
break;