Skip to content

Commit a059051

Browse files
authored
[7.17] Fix NodeMetadataTests#testEqualsHashcodeSerialization (#83170) (#83194)
* Fix NodeMetadataTests#testEqualsHashcodeSerialization (#83170) The mutation function would rarely fail to mutate the input object. This commit fixes that. Relates #82689 * Old-skool switch
1 parent 2fb3c46 commit a059051

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/src/test/java/org/elasticsearch/env/NodeMetadataTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@ public void testEqualsHashcodeSerialization() {
5252
return new NodeMetadata(
5353
randomAlphaOfLength(21 - nodeMetadata.nodeId().length()),
5454
nodeMetadata.nodeVersion(),
55-
Version.CURRENT
55+
nodeMetadata.oldestIndexVersion()
5656
);
5757
case 1:
5858
return new NodeMetadata(
5959
nodeMetadata.nodeId(),
6060
randomValueOtherThan(nodeMetadata.nodeVersion(), this::randomVersion),
61-
Version.CURRENT
61+
nodeMetadata.oldestIndexVersion()
6262
);
6363
default:
6464
return new NodeMetadata(
6565
nodeMetadata.nodeId(),
6666
nodeMetadata.nodeVersion(),
67-
randomValueOtherThan(Version.CURRENT, this::randomVersion)
67+
randomValueOtherThan(nodeMetadata.oldestIndexVersion(), this::randomVersion)
6868
);
6969
}
7070
}

0 commit comments

Comments
 (0)