mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-12 10:55:46 +02:00
chore: preparation step for lock fingerprints (#2899)
The main change here is introduction of the strong type LockTag that differentiates from a string_view key. Also, some testing improvements to improve the footprint of the next PR. Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
4fe00a071e
commit
8030ee96b5
18 changed files with 175 additions and 157 deletions
|
@ -677,6 +677,19 @@ fb2::Fiber BaseFamilyTest::ExpectConditionWithSuspension(const std::function<boo
|
|||
return fb;
|
||||
}
|
||||
|
||||
util::fb2::Fiber BaseFamilyTest::ExpectUsedKeys(const std::vector<std::string_view>& keys) {
|
||||
absl::flat_hash_set<string> own_keys;
|
||||
for (const auto& k : keys) {
|
||||
own_keys.insert(string(k));
|
||||
}
|
||||
auto cb = [=] {
|
||||
auto last_keys = GetLastUsedKeys();
|
||||
return last_keys == own_keys;
|
||||
};
|
||||
|
||||
return ExpectConditionWithSuspension(std::move(cb));
|
||||
}
|
||||
|
||||
void BaseFamilyTest::SetTestFlag(string_view flag_name, string_view new_value) {
|
||||
auto* flag = absl::FindCommandLineFlag(flag_name);
|
||||
CHECK_NE(flag, nullptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue