[TEST] don't use multiple names (e.g. aliases) pointing to the same concrete index when using indexRandom
indexRandom will try to delete bogus documents multiple times since they get tracked by indexOrAlias/id, and after the actual deletion any other attempt throws error and fails the test
This commit is contained in:
parent
5d987ad5e2
commit
0ec7aa4492
|
@ -136,12 +136,12 @@ public class BasicBackwardsCompatibilityTest extends ElasticsearchBackwardsCompa
|
|||
*/
|
||||
@Test
|
||||
public void testIndexAndSearch() throws Exception {
|
||||
assertAcked(prepareCreate("test").addAlias(new Alias("alias")));
|
||||
createIndex("test");
|
||||
int numDocs = randomIntBetween(10, 20);
|
||||
List<IndexRequestBuilder> builder = new ArrayList<>();
|
||||
for (int i = 0; i < numDocs; i++) {
|
||||
String id = Integer.toString(i);
|
||||
builder.add(client().prepareIndex(indexOrAlias(), "type1", id).setSource("field1", English.intToEnglish(i), "the_id", id));
|
||||
builder.add(client().prepareIndex("test", "type1", id).setSource("field1", English.intToEnglish(i), "the_id", id));
|
||||
}
|
||||
indexRandom(true, builder);
|
||||
for (int i = 0; i < numDocs; i++) {
|
||||
|
|
Loading…
Reference in New Issue