File tree 1 file changed +4
-1
lines changed
core/src/test/java/org/elasticsearch/index/mapper
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 35
35
36
36
import java .io .IOException ;
37
37
import java .util .Arrays ;
38
+ import java .util .HashSet ;
38
39
import java .util .Map ;
40
+ import java .util .Set ;
39
41
40
42
import static org .elasticsearch .common .xcontent .XContentFactory .jsonBuilder ;
41
43
import static org .elasticsearch .test .StreamsUtils .copyToBytesFromClasspath ;
@@ -155,8 +157,9 @@ public void testBuildThenParse() throws Exception {
155
157
// can to unnecessary re-syncing of the mappings between the local instance and cluster state
156
158
public void testMultiFieldsInConsistentOrder () throws Exception {
157
159
String [] multiFieldNames = new String [randomIntBetween (2 , 10 )];
160
+ Set <String > seenFields = new HashSet <>();
158
161
for (int i = 0 ; i < multiFieldNames .length ; i ++) {
159
- multiFieldNames [i ] = randomAlphaOfLength (4 );
162
+ multiFieldNames [i ] = randomValueOtherThanMany ( s -> ! seenFields . add ( s ), () -> randomAlphaOfLength (4 ) );
160
163
}
161
164
162
165
XContentBuilder builder = jsonBuilder ().startObject ().startObject ("type" ).startObject ("properties" )
You can’t perform that action at this time.
0 commit comments