From fc2bfdbacf83242c0a019ab6bd0297ba81a09ed2 Mon Sep 17 00:00:00 2001 From: Lukas Joswiak Date: Thu, 4 Nov 2021 10:40:03 -0700 Subject: [PATCH] Remove unit tests dependent on knob --- bindings/c/test/unit/unit_tests.cpp | 68 ++++++++++++++--------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/bindings/c/test/unit/unit_tests.cpp b/bindings/c/test/unit/unit_tests.cpp index f59c7f953b..e0ca4ee752 100644 --- a/bindings/c/test/unit/unit_tests.cpp +++ b/bindings/c/test/unit/unit_tests.cpp @@ -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;