From 0ec7aa449211a956da5f4560c12b925a1edf64b9 Mon Sep 17 00:00:00 2001 From: javanna Date: Tue, 12 Aug 2014 14:33:18 +0200 Subject: [PATCH] [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 --- .../bwcompat/BasicBackwardsCompatibilityTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/elasticsearch/bwcompat/BasicBackwardsCompatibilityTest.java b/src/test/java/org/elasticsearch/bwcompat/BasicBackwardsCompatibilityTest.java index fdb36e3fec0..f414e29c442 100644 --- a/src/test/java/org/elasticsearch/bwcompat/BasicBackwardsCompatibilityTest.java +++ b/src/test/java/org/elasticsearch/bwcompat/BasicBackwardsCompatibilityTest.java @@ -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 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++) {