From 4794345efb0e78e41359a13a4a37e9b7143bfd60 Mon Sep 17 00:00:00 2001 From: Igor Motov Date: Thu, 16 Jun 2011 23:21:30 -0400 Subject: [PATCH] Remove unnecessary Thread.sleep calls after alias creation --- .../test/integration/aliases/IndexAliasesTests.java | 7 ------- .../test/integration/routing/AliasResolveRoutingTests.java | 2 -- .../test/integration/routing/AliasRoutingTests.java | 7 ------- 3 files changed, 16 deletions(-) diff --git a/modules/test/integration/src/test/java/org/elasticsearch/test/integration/aliases/IndexAliasesTests.java b/modules/test/integration/src/test/java/org/elasticsearch/test/integration/aliases/IndexAliasesTests.java index 67e1e73a427..a5370b7af96 100644 --- a/modules/test/integration/src/test/java/org/elasticsearch/test/integration/aliases/IndexAliasesTests.java +++ b/modules/test/integration/src/test/java/org/elasticsearch/test/integration/aliases/IndexAliasesTests.java @@ -114,7 +114,6 @@ public class IndexAliasesTests extends AbstractNodesTests { logger.info("--> aliasing index [test] with [alias1]"); client1.admin().indices().prepareAliases().addAlias("test", "alias1").execute().actionGet(); - Thread.sleep(300); logger.info("--> indexing against [alias1], should work now"); IndexResponse indexResponse = client1.index(indexRequest("alias1").type("type1").id("1").source(source("1", "test"))).actionGet(); @@ -176,7 +175,6 @@ public class IndexAliasesTests extends AbstractNodesTests { logger.info("--> aliasing index [test] with [alias1] and filter [user:kimchy]"); FilterBuilder filter = termFilter("user", "kimchy"); client1.admin().indices().prepareAliases().addAlias("test", "alias1", filter).execute().actionGet(); - Thread.sleep(300); // For now just making sure that filter was stored with the alias logger.info("--> making sure that filter was stored with alias [alias1] and filter [user:kimchy]"); @@ -205,7 +203,6 @@ public class IndexAliasesTests extends AbstractNodesTests { client1.admin().indices().prepareAliases().addAlias("test", "foos", termFilter("name", "foo")).execute().actionGet(); client1.admin().indices().prepareAliases().addAlias("test", "bars", termFilter("name", "bar")).execute().actionGet(); client1.admin().indices().prepareAliases().addAlias("test", "tests", termFilter("name", "test")).execute().actionGet(); - Thread.sleep(300); logger.info("--> indexing against [test]"); client1.index(indexRequest("test").type("type1").id("1").source(source("1", "foo test")).refresh(true)).actionGet(); @@ -262,7 +259,6 @@ public class IndexAliasesTests extends AbstractNodesTests { client1.admin().indices().prepareAliases().addAlias("test2", "aliasToTest2").execute().actionGet(); client1.admin().indices().prepareAliases().addAlias("test2", "aliasToTests").execute().actionGet(); client1.admin().indices().prepareAliases().addAlias("test2", "foos", termFilter("name", "foo")).execute().actionGet(); - Thread.sleep(300); logger.info("--> indexing against [test1]"); client1.index(indexRequest("test1").type("type1").id("1").source(source("1", "foo test")).refresh(true)).actionGet(); @@ -335,8 +331,6 @@ public class IndexAliasesTests extends AbstractNodesTests { client1.admin().indices().prepareAliases().addAlias("test1", "filter13", termFilter("name", "baz")).execute().actionGet(); client1.admin().indices().prepareAliases().addAlias("test3", "filter13", termFilter("name", "baz")).execute().actionGet(); - Thread.sleep(300); - logger.info("--> indexing against [test1]"); client1.index(indexRequest("test1").type("type1").id("11").source(source("11", "foo test1")).refresh(true)).actionGet(); client1.index(indexRequest("test1").type("type1").id("12").source(source("12", "bar test1")).refresh(true)).actionGet(); @@ -405,7 +399,6 @@ public class IndexAliasesTests extends AbstractNodesTests { client1.admin().indices().prepareAliases().addAlias("test2", "aliasToTests").execute().actionGet(); client1.admin().indices().prepareAliases().addAlias("test2", "foos", termFilter("name", "foo")).execute().actionGet(); client1.admin().indices().prepareAliases().addAlias("test2", "tests", termFilter("name", "test")).execute().actionGet(); - Thread.sleep(300); logger.info("--> indexing against [test1]"); client1.index(indexRequest("test1").type("type1").id("1").source(source("1", "foo test")).refresh(true)).actionGet(); diff --git a/modules/test/integration/src/test/java/org/elasticsearch/test/integration/routing/AliasResolveRoutingTests.java b/modules/test/integration/src/test/java/org/elasticsearch/test/integration/routing/AliasResolveRoutingTests.java index e4783986bc0..a0b2b637140 100644 --- a/modules/test/integration/src/test/java/org/elasticsearch/test/integration/routing/AliasResolveRoutingTests.java +++ b/modules/test/integration/src/test/java/org/elasticsearch/test/integration/routing/AliasResolveRoutingTests.java @@ -80,7 +80,6 @@ public class AliasResolveRoutingTests extends AbstractNodesTests { client.admin().indices().prepareAliases().addAliasAction(newAddAliasAction("test2", "alias21").routing("1")).execute().actionGet(); client.admin().indices().prepareAliases().addAliasAction(newAddAliasAction("test1", "alias0").routing("0")).execute().actionGet(); client.admin().indices().prepareAliases().addAliasAction(newAddAliasAction("test2", "alias0").routing("0")).execute().actionGet(); - Thread.sleep(300); assertThat(clusterService.state().metaData().resolveIndexRouting(null, "test1"), nullValue()); assertThat(clusterService.state().metaData().resolveIndexRouting(null, "alias"), nullValue()); @@ -124,7 +123,6 @@ public class AliasResolveRoutingTests extends AbstractNodesTests { client.admin().indices().prepareAliases().addAliasAction(newAddAliasAction("test2", "alias21").routing("1")).execute().actionGet(); client.admin().indices().prepareAliases().addAliasAction(newAddAliasAction("test1", "alias0").routing("0")).execute().actionGet(); client.admin().indices().prepareAliases().addAliasAction(newAddAliasAction("test2", "alias0").routing("0")).execute().actionGet(); - Thread.sleep(300); assertThat(clusterService.state().metaData().resolveSearchRouting(null, "alias"), nullValue()); assertThat(clusterService.state().metaData().resolveSearchRouting("0,1", "alias"), equalTo(newMap("test1", newSet("0", "1")))); diff --git a/modules/test/integration/src/test/java/org/elasticsearch/test/integration/routing/AliasRoutingTests.java b/modules/test/integration/src/test/java/org/elasticsearch/test/integration/routing/AliasRoutingTests.java index 3b84fc34296..4e3ac42ccaa 100644 --- a/modules/test/integration/src/test/java/org/elasticsearch/test/integration/routing/AliasRoutingTests.java +++ b/modules/test/integration/src/test/java/org/elasticsearch/test/integration/routing/AliasRoutingTests.java @@ -67,7 +67,6 @@ public class AliasRoutingTests extends AbstractNodesTests { client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet(); client.admin().indices().prepareAliases().addAliasAction(newAddAliasAction("test", "alias0").routing("0")).execute().actionGet(); - Thread.sleep(300); logger.info("--> indexing with id [1], and routing [0] using alias"); client.prepareIndex("alias0", "type1", "1").setSource("field", "value1").setRefresh(true).execute().actionGet(); @@ -149,7 +148,6 @@ public class AliasRoutingTests extends AbstractNodesTests { .addAliasAction(newAddAliasAction("test", "alias1").routing("1")) .addAliasAction(newAddAliasAction("test", "alias01").searchRouting("0,1")) .execute().actionGet(); - Thread.sleep(300); logger.info("--> indexing with id [1], and routing [0] using alias"); @@ -257,8 +255,6 @@ public class AliasRoutingTests extends AbstractNodesTests { .addAliasAction(newAddAliasAction("test-a", "alias-ab").searchRouting("0")) .addAliasAction(newAddAliasAction("test-b", "alias-ab").searchRouting("1")) .execute().actionGet(); - Thread.sleep(300); - logger.info("--> indexing with id [1], and routing [0] using alias to test-a"); client.prepareIndex("alias-a0", "type1", "1").setSource("field", "value1").setRefresh(true).execute().actionGet(); @@ -364,7 +360,6 @@ public class AliasRoutingTests extends AbstractNodesTests { client.admin().indices().prepareAliases() .addAliasAction(newAddAliasAction("test", "alias").routing("3")) .execute().actionGet(); - Thread.sleep(300); logger.info("--> indexing with id [0], and routing [3]"); client.prepareIndex("alias", "type1", "0").setSource("field", "value1").setRefresh(true).execute().actionGet(); @@ -381,7 +376,6 @@ public class AliasRoutingTests extends AbstractNodesTests { client.admin().indices().prepareAliases() .addAliasAction(newAddAliasAction("test", "alias").routing("4")) .execute().actionGet(); - Thread.sleep(300); logger.info("--> verifying search with wrong routing should not find"); for (int i = 0; i < 5; i++) { @@ -393,7 +387,6 @@ public class AliasRoutingTests extends AbstractNodesTests { client.admin().indices().prepareAliases() .addAliasAction(newAddAliasAction("test", "alias").searchRouting("3,4").indexRouting("4")) .execute().actionGet(); - Thread.sleep(300); logger.info("--> indexing with id [1], and routing [4]"); client.prepareIndex("alias", "type1", "1").setSource("field", "value2").setRefresh(true).execute().actionGet();