Skip to content

Commit 9cdbcbd

Browse files
authored
[TEST] Exclude name on ScriptContextInfo mutate (#50332) (#50337)
ScriptContextInfoSerializingTests:testEqualsAndHashcode was failing because the mutation was generating the same name. **Backport** Fixes: #50331
1 parent 4396a1f commit 9cdbcbd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/ScriptContextInfoSerializingTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ protected ScriptContextInfo mutateInstance(ScriptContextInfo instance) throws IO
5656
}
5757

5858
private static ScriptContextInfo mutate(ScriptContextInfo instance, Set<String> names) {
59-
if (names == null) { names = new HashSet<>(); }
59+
if (names == null) {
60+
names = new HashSet<>();
61+
names.add(instance.name);
62+
}
6063
switch (randomIntBetween(0, 2)) {
6164
case 0:
6265
return new ScriptContextInfo(

0 commit comments

Comments
 (0)