Skip to content

Commit d96c180

Browse files
dnhatnkcm
authored andcommitted
TEST: Index diff num docs in rolling upgrade tests (#34191)
Today we index the same number of documents (50 documents) in each round of the rolling upgrade tests. If the actual count does not match, we can not guess the problematic round. Relates #27650
1 parent f193287 commit d96c180

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/RecoveryIT.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ public void testRecoveryWithConcurrentIndexing() throws Exception {
148148
break;
149149
case UPGRADED:
150150
updateIndexSettings(index, Settings.builder().put(INDEX_ROUTING_ALLOCATION_ENABLE_SETTING.getKey(), (String)null));
151-
asyncIndexDocs(index, 60, 50).get();
151+
asyncIndexDocs(index, 60, 45).get();
152152
ensureGreen(index);
153153
client().performRequest(new Request("POST", index + "/_refresh"));
154-
assertCount(index, "_only_nodes:" + nodes.get(0), 110);
155-
assertCount(index, "_only_nodes:" + nodes.get(1), 110);
156-
assertCount(index, "_only_nodes:" + nodes.get(2), 110);
154+
assertCount(index, "_only_nodes:" + nodes.get(0), 105);
155+
assertCount(index, "_only_nodes:" + nodes.get(1), 105);
156+
assertCount(index, "_only_nodes:" + nodes.get(2), 105);
157157
break;
158158
default:
159159
throw new IllegalStateException("unknown type " + CLUSTER_TYPE);
@@ -165,7 +165,7 @@ private void assertCount(final String index, final String preference, final int
165165
request.addParameter("preference", preference);
166166
final Response response = client().performRequest(request);
167167
final int actualCount = Integer.parseInt(ObjectPath.createFromResponse(response).evaluate("count").toString());
168-
assertThat(actualCount, equalTo(expectedCount));
168+
assertThat("preference [" + preference + "]", actualCount, equalTo(expectedCount));
169169
}
170170

171171

@@ -225,17 +225,17 @@ public void testRelocationWithConcurrentIndexing() throws Exception {
225225
.put(IndexMetaData.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 2)
226226
.put("index.routing.allocation.include._id", (String)null)
227227
);
228-
asyncIndexDocs(index, 60, 50).get();
228+
asyncIndexDocs(index, 60, 45).get();
229229
ensureGreen(index);
230230
client().performRequest(new Request("POST", index + "/_refresh"));
231231
Response response = client().performRequest(new Request("GET", "_nodes"));
232232
ObjectPath objectPath = ObjectPath.createFromResponse(response);
233233
final Map<String, Object> nodeMap = objectPath.evaluate("nodes");
234234
List<String> nodes = new ArrayList<>(nodeMap.keySet());
235235

236-
assertCount(index, "_only_nodes:" + nodes.get(0), 110);
237-
assertCount(index, "_only_nodes:" + nodes.get(1), 110);
238-
assertCount(index, "_only_nodes:" + nodes.get(2), 110);
236+
assertCount(index, "_only_nodes:" + nodes.get(0), 105);
237+
assertCount(index, "_only_nodes:" + nodes.get(1), 105);
238+
assertCount(index, "_only_nodes:" + nodes.get(2), 105);
239239
break;
240240
default:
241241
throw new IllegalStateException("unknown type " + CLUSTER_TYPE);

0 commit comments

Comments
 (0)