Fix Validity of RepositoryDataTests Randomness (#48564) (#48566)

Trivial point, but we were only testing shard generations
for a single shard here, accidentally, and not testing the
`null` generation case at all.
This commit is contained in:
Armin Braun 2019-10-28 11:04:57 +01:00 committed by GitHub
parent 51c1b48b24
commit 53a22b8a8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -276,7 +276,8 @@ public class RepositoryDataTests extends ESTestCase {
for (IndexId someIndex : someIndices) {
final int shardCount = randomIntBetween(1, 10);
for (int j = 0; j < shardCount; ++j) {
builder.put(someIndex, 0, UUIDs.randomBase64UUID(random()));
final String uuid = randomBoolean() ? null : UUIDs.randomBase64UUID(random());
builder.put(someIndex, j, uuid);
}
}
repositoryData = repositoryData.addSnapshot(snapshotId, randomFrom(SnapshotState.values()), builder.build());