Skip to content

Commit

Permalink
Fix Validity of RepositoryDataTests Randomness (#48564)
Browse files Browse the repository at this point in the history
Trivial point, but we were only testing shard generations
for a single shard here, accidentally, and not testing the
`null` generation case at all.
  • Loading branch information
original-brownbear authored Oct 28, 2019
1 parent 54eda8d commit 0394e74
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ public static RepositoryData generateRandomRepoData() {
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());
Expand Down

0 comments on commit 0394e74

Please sign in to comment.