Skip to content

Commit 53a22b8

Browse files
Fix Validity of RepositoryDataTests Randomness (elastic#48564) (elastic#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.
1 parent 51c1b48 commit 53a22b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/test/java/org/elasticsearch/repositories/RepositoryDataTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ public static RepositoryData generateRandomRepoData() {
276276
for (IndexId someIndex : someIndices) {
277277
final int shardCount = randomIntBetween(1, 10);
278278
for (int j = 0; j < shardCount; ++j) {
279-
builder.put(someIndex, 0, UUIDs.randomBase64UUID(random()));
279+
final String uuid = randomBoolean() ? null : UUIDs.randomBase64UUID(random());
280+
builder.put(someIndex, j, uuid);
280281
}
281282
}
282283
repositoryData = repositoryData.addSnapshot(snapshotId, randomFrom(SnapshotState.values()), builder.build());

0 commit comments

Comments
 (0)