change watchCheck to coinflip; rename noDestroy

This commit is contained in:
Xiaoxi Wang 2023-01-06 15:56:22 -08:00
parent f049c3d74d
commit ef17634174
2 changed files with 8 additions and 10 deletions

View File

@ -1696,11 +1696,11 @@ struct TenantManagementWorkload : TestWorkload {
// Run a random sequence of tenant management operations for the duration of the test
while (now() < start + self->testDuration) {
state int operation = deterministicRandom()->randomInt(0, 9);
state int operation = deterministicRandom()->randomInt(0, 8);
if (operation == 0) {
wait(createTenant(self));
} else if (operation == 1) {
wait(deleteTenant(self, false));
wait(deleteTenant(self, deterministicRandom()->coinflip()));
} else if (operation == 2) {
wait(getTenant(self));
} else if (operation == 3) {
@ -1713,8 +1713,6 @@ struct TenantManagementWorkload : TestWorkload {
wait(getTenantGroup(self));
} else if (operation == 7) {
wait(listTenantGroups(self));
} else if (operation == 8) {
wait(deleteTenant(self, true));
}
}

View File

@ -575,20 +575,20 @@ public:
void sendError(K const& begin, K const& end, Error const& e) {
if (begin >= end)
return;
std::vector<Promise<Void>> noDestroy = swapRangePromises(items.lower_bound(begin), items.lower_bound(end));
sendError(noDestroy, e);
std::vector<Promise<Void>> ps = swapRangePromises(items.lower_bound(begin), items.lower_bound(end));
sendError(ps, e);
}
void triggerAll() {
std::vector<Promise<Void>> noDestroy = swapRangePromises(items.begin(), items.end());
send(noDestroy);
std::vector<Promise<Void>> ps = swapRangePromises(items.begin(), items.end());
send(ps);
}
void triggerRange(K const& begin, K const& end) {
if (begin >= end)
return;
std::vector<Promise<Void>> noDestroy = swapRangePromises(items.lower_bound(begin), items.lower_bound(end));
send(noDestroy);
std::vector<Promise<Void>> ps = swapRangePromises(items.lower_bound(begin), items.lower_bound(end));
send(ps);
}
void trigger(K const& key) {