Browse Source

[TEST] moved routing REST tests to 0 replicas

REST tests get run against either 1 node or multiple nodes. Wait for yellow with replicas>0 is not enough when running against multiple nodes as replicas shard might get initialized  during testing, which can cause timing issues.
Luca Cavanna 11 years ago
parent
commit
63eccce8f9

+ 12 - 3
rest-api-spec/test/create/40_routing.yaml

@@ -1,6 +1,18 @@
 ---
 "Routing":
 
+ - do:
+     indices.create:
+       index:    test_1
+       body:
+         settings:
+           index:
+             number_of_replicas: 0
+
+ - do:
+      cluster.health:
+          wait_for_status: green
+
  - do:
       create:
           index:   test_1
@@ -8,9 +20,6 @@
           id:      1
           routing: 5
           body:    { foo: bar }
- - do:
-      cluster.health:
-          wait_for_status: yellow
 
  - do:
       get:

+ 4 - 1
rest-api-spec/test/create/55_parent_with_routing.yaml

@@ -8,9 +8,12 @@
             mappings:
               test:
                 _parent: { type: "foo" }
+            settings:
+              number_of_replicas: 0
+
  - do:
       cluster.health:
-          wait_for_status: yellow
+          wait_for_status: green
 
  - do:
       create:

+ 4 - 1
rest-api-spec/test/delete/45_parent_with_routing.yaml

@@ -8,9 +8,12 @@
             mappings:
               test:
                 _parent: { type: "foo" }
+            settings:
+              number_of_replicas: 0
+
  - do:
       cluster.health:
-          wait_for_status: yellow
+          wait_for_status: green
 
  - do:
       index:

+ 13 - 3
rest-api-spec/test/exists/40_routing.yaml

@@ -1,6 +1,18 @@
 ---
 "Routing":
 
+ - do:
+     indices.create:
+       index:    test_1
+       body:
+         settings:
+           index:
+             number_of_replicas: 0
+
+ - do:
+      cluster.health:
+          wait_for_status: green
+
  - do:
       index:
           index:   test_1
@@ -8,9 +20,7 @@
           id:      1
           routing: 5
           body:    { foo: bar }
- - do:
-      cluster.health:
-          wait_for_status: yellow
+
  - do:
       exists:
           index:   test_1

+ 4 - 1
rest-api-spec/test/exists/55_parent_with_routing.yaml

@@ -8,9 +8,12 @@
             mappings:
               test:
                 _parent: { type: "foo" }
+            settings:
+              number_of_replicas: 0
+
  - do:
       cluster.health:
-          wait_for_status: yellow
+          wait_for_status: green
 
  - do:
       index:

+ 13 - 3
rest-api-spec/test/get/40_routing.yaml

@@ -1,6 +1,18 @@
 ---
 "Routing":
 
+ - do:
+     indices.create:
+       index:    test_1
+       body:
+         settings:
+           index:
+             number_of_replicas: 0
+
+ - do:
+      cluster.health:
+          wait_for_status: green
+
  - do:
       index:
           index:   test_1
@@ -8,9 +20,7 @@
           id:      1
           routing: 5
           body:    { foo: bar }
- - do:
-      cluster.health:
-          wait_for_status: yellow
+
  - do:
       get:
           index:   test_1

+ 4 - 1
rest-api-spec/test/get/55_parent_with_routing.yaml

@@ -8,9 +8,12 @@
             mappings:
               test:
                 _parent: { type: "foo" }
+            settings:
+              number_of_replicas: 0
+
  - do:
       cluster.health:
-          wait_for_status: yellow
+          wait_for_status: green
 
  - do:
       index:

+ 13 - 3
rest-api-spec/test/get_source/40_routing.yaml

@@ -1,6 +1,18 @@
 ---
 "Routing":
 
+ - do:
+     indices.create:
+       index:    test_1
+       body:
+         settings:
+           index:
+             number_of_replicas: 0
+
+ - do:
+      cluster.health:
+          wait_for_status: green
+
  - do:
       index:
           index:   test_1
@@ -8,9 +20,7 @@
           id:      1
           routing: 5
           body:    { foo: bar }
- - do:
-      cluster.health:
-          wait_for_status: yellow
+
  - do:
       get_source:
           index:   test_1

+ 4 - 1
rest-api-spec/test/get_source/55_parent_with_routing.yaml

@@ -8,9 +8,12 @@
             mappings:
               test:
                 _parent: { type: "foo" }
+            settings:
+              number_of_replicas: 0
+
  - do:
       cluster.health:
-          wait_for_status: yellow
+          wait_for_status: green
 
  - do:
       index:

+ 12 - 3
rest-api-spec/test/index/40_routing.yaml

@@ -1,6 +1,18 @@
 ---
 "Routing":
 
+ - do:
+     indices.create:
+       index:    test_1
+       body:
+         settings:
+           index:
+             number_of_replicas: 0
+
+ - do:
+      cluster.health:
+          wait_for_status: green
+
  - do:
       index:
           index:   test_1
@@ -8,9 +20,6 @@
           id:      1
           routing: 5
           body:    { foo: bar }
- - do:
-      cluster.health:
-          wait_for_status: yellow
 
  - do:
       get:

+ 4 - 1
rest-api-spec/test/index/55_parent_with_routing.yaml

@@ -8,9 +8,12 @@
             mappings:
               test:
                 _parent: { type: "foo" }
+            settings:
+              number_of_replicas: 0
+
  - do:
       cluster.health:
-          wait_for_status: yellow
+          wait_for_status: green
 
  - do:
       index:

+ 13 - 3
rest-api-spec/test/mget/40_routing.yaml

@@ -1,6 +1,18 @@
 ---
 "Routing":
 
+ - do:
+     indices.create:
+       index:    test_1
+       body:
+         settings:
+           index:
+             number_of_replicas: 0
+
+ - do:
+      cluster.health:
+          wait_for_status: green
+
  - do:
       index:
           index:   test_1
@@ -8,9 +20,7 @@
           id:      1
           routing: 5
           body:    { foo: bar }
- - do:
-      cluster.health:
-          wait_for_status: yellow
+
  - do:
       mget:
           index:   test_1

+ 4 - 1
rest-api-spec/test/mget/55_parent_with_routing.yaml

@@ -8,9 +8,12 @@
             mappings:
               test:
                 _parent: { type: "foo" }
+            settings:
+              number_of_replicas: 0
+
  - do:
       cluster.health:
-          wait_for_status: yellow
+          wait_for_status: green
 
  - do:
       index:

+ 12 - 0
rest-api-spec/test/update/40_routing.yaml

@@ -1,6 +1,18 @@
 ---
 "Routing":
 
+ - do:
+     indices.create:
+       index:    test_1
+       body:
+         settings:
+           index:
+             number_of_replicas: 0
+
+ - do:
+      cluster.health:
+          wait_for_status: green
+
  - do:
       update:
           index:   test_1

+ 4 - 1
rest-api-spec/test/update/55_parent_with_routing.yaml

@@ -8,9 +8,12 @@
             mappings:
               test:
                 _parent: { type: "foo" }
+            settings:
+              number_of_replicas: 0
+
  - do:
       cluster.health:
-          wait_for_status: yellow
+          wait_for_status: green
 
  - do:
       update: