Test ids > 16 bytes in workload

This commit is contained in:
Andrew Noyes 2022-10-11 13:46:17 -07:00
parent d8cadbd6c0
commit 9e7630869e
1 changed files with 4 additions and 1 deletions

View File

@ -46,7 +46,10 @@ struct AutomaticIdempotencyWorkload : TestWorkload {
ACTOR static Future<Void> _start(AutomaticIdempotencyWorkload* self, Database cx) { ACTOR static Future<Void> _start(AutomaticIdempotencyWorkload* self, Database cx) {
state int i = 0; state int i = 0;
for (; i < self->numTransactions; ++i) { for (; i < self->numTransactions; ++i) {
state Value idempotencyId = BinaryWriter::toValue(deterministicRandom()->randomUniqueID(), Unversioned()); // Half direct representation, half indirect representation
int length = deterministicRandom()->coinflip() ? 16 : deterministicRandom()->randomInt(17, 256);
state Value idempotencyId = makeString(length);
deterministicRandom()->randomBytes(mutateString(idempotencyId), length);
TraceEvent("IdempotencyIdWorkloadTransaction").detail("Id", idempotencyId); TraceEvent("IdempotencyIdWorkloadTransaction").detail("Id", idempotencyId);
wait(runRYWTransaction( wait(runRYWTransaction(
cx, [self = self, idempotencyId = idempotencyId](Reference<ReadYourWritesTransaction> tr) { cx, [self = self, idempotencyId = idempotencyId](Reference<ReadYourWritesTransaction> tr) {