@@ -78,18 +78,10 @@ public void testEnrichWithHostsPolicyAndDisconnectedRemotesWithSkipUnavailableTr
78
78
assertThat (executionInfo .clusterAliases (), equalTo (Set .of (REMOTE_CLUSTER_1 , REMOTE_CLUSTER_2 )));
79
79
80
80
EsqlExecutionInfo .Cluster cluster1 = executionInfo .getCluster (REMOTE_CLUSTER_1 );
81
- assertThat (cluster1 .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
82
- assertThat (cluster1 .getTotalShards (), equalTo (0 ));
83
- assertThat (cluster1 .getSuccessfulShards (), equalTo (0 ));
84
- assertThat (cluster1 .getSkippedShards (), equalTo (0 ));
85
- assertThat (cluster1 .getFailedShards (), equalTo (0 ));
81
+ assertClusterInfoSkipped (cluster1 );
86
82
87
83
EsqlExecutionInfo .Cluster cluster2 = executionInfo .getCluster (REMOTE_CLUSTER_2 );
88
- assertThat (cluster2 .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SUCCESSFUL ));
89
- assertThat (cluster2 .getTotalShards (), greaterThanOrEqualTo (0 ));
90
- assertThat (cluster2 .getSuccessfulShards (), equalTo (cluster2 .getSuccessfulShards ()));
91
- assertThat (cluster2 .getSkippedShards (), equalTo (0 ));
92
- assertThat (cluster2 .getFailedShards (), equalTo (0 ));
84
+ assertClusterInfoSuccess (cluster2 , cluster2 .getSuccessfulShards ());
93
85
}
94
86
}
95
87
@@ -116,18 +108,10 @@ public void testEnrichWithHostsPolicyAndDisconnectedRemotesWithSkipUnavailableTr
116
108
assertThat (executionInfo .clusterAliases (), equalTo (Set .of (REMOTE_CLUSTER_1 , REMOTE_CLUSTER_2 )));
117
109
118
110
EsqlExecutionInfo .Cluster cluster1 = executionInfo .getCluster (REMOTE_CLUSTER_1 );
119
- assertThat (cluster1 .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
120
- assertThat (cluster1 .getTotalShards (), equalTo (0 ));
121
- assertThat (cluster1 .getSuccessfulShards (), equalTo (0 ));
122
- assertThat (cluster1 .getSkippedShards (), equalTo (0 ));
123
- assertThat (cluster1 .getFailedShards (), equalTo (0 ));
111
+ assertClusterInfoSkipped (cluster1 );
124
112
125
113
EsqlExecutionInfo .Cluster cluster2 = executionInfo .getCluster (REMOTE_CLUSTER_2 );
126
- assertThat (cluster2 .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
127
- assertThat (cluster2 .getTotalShards (), equalTo (0 ));
128
- assertThat (cluster2 .getSuccessfulShards (), equalTo (0 ));
129
- assertThat (cluster2 .getSkippedShards (), equalTo (0 ));
130
- assertThat (cluster2 .getFailedShards (), equalTo (0 ));
114
+ assertClusterInfoSkipped (cluster2 );
131
115
}
132
116
}
133
117
} finally {
@@ -160,18 +144,10 @@ public void testEnrichWithHostsPolicyAndDisconnectedRemotesWithSkipUnavailableFa
160
144
assertThat (executionInfo .clusterAliases (), equalTo (Set .of (REMOTE_CLUSTER_1 , REMOTE_CLUSTER_2 )));
161
145
162
146
EsqlExecutionInfo .Cluster cluster1 = executionInfo .getCluster (REMOTE_CLUSTER_1 );
163
- assertThat (cluster1 .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
164
- assertThat (cluster1 .getTotalShards (), equalTo (0 ));
165
- assertThat (cluster1 .getSuccessfulShards (), equalTo (0 ));
166
- assertThat (cluster1 .getSkippedShards (), equalTo (0 ));
167
- assertThat (cluster1 .getFailedShards (), equalTo (0 ));
147
+ assertClusterInfoSkipped (cluster1 );
168
148
169
149
EsqlExecutionInfo .Cluster cluster2 = executionInfo .getCluster (REMOTE_CLUSTER_2 );
170
- assertThat (cluster2 .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SUCCESSFUL ));
171
- assertThat (cluster2 .getTotalShards (), greaterThanOrEqualTo (0 ));
172
- assertThat (cluster2 .getSuccessfulShards (), equalTo (cluster2 .getSuccessfulShards ()));
173
- assertThat (cluster2 .getSkippedShards (), equalTo (0 ));
174
- assertThat (cluster2 .getFailedShards (), equalTo (0 ));
150
+ assertClusterInfoSuccess (cluster2 , cluster2 .getSuccessfulShards ());
175
151
}
176
152
}
177
153
@@ -218,25 +194,13 @@ public void testEnrichTwiceThenAggsWithUnavailableRemotes() throws IOException {
218
194
assertCCSExecutionInfoDetails (executionInfo );
219
195
220
196
EsqlExecutionInfo .Cluster cluster1 = executionInfo .getCluster (REMOTE_CLUSTER_1 );
221
- assertThat (cluster1 .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SUCCESSFUL ));
222
- assertThat (cluster1 .getTotalShards (), greaterThanOrEqualTo (0 ));
223
- assertThat (cluster1 .getSuccessfulShards (), equalTo (cluster1 .getSuccessfulShards ()));
224
- assertThat (cluster1 .getSkippedShards (), equalTo (0 ));
225
- assertThat (cluster1 .getFailedShards (), equalTo (0 ));
197
+ assertClusterInfoSuccess (cluster1 , cluster1 .getSuccessfulShards ());
226
198
227
199
EsqlExecutionInfo .Cluster cluster2 = executionInfo .getCluster (REMOTE_CLUSTER_2 );
228
- assertThat (cluster2 .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
229
- assertThat (cluster2 .getTotalShards (), equalTo (0 ));
230
- assertThat (cluster2 .getSuccessfulShards (), equalTo (0 ));
231
- assertThat (cluster2 .getSkippedShards (), equalTo (0 ));
232
- assertThat (cluster2 .getFailedShards (), equalTo (0 ));
200
+ assertClusterInfoSkipped (cluster2 );
233
201
234
202
EsqlExecutionInfo .Cluster localCluster = executionInfo .getCluster (RemoteClusterAware .LOCAL_CLUSTER_GROUP_KEY );
235
- assertThat (localCluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SUCCESSFUL ));
236
- assertThat (localCluster .getTotalShards (), greaterThan (0 ));
237
- assertThat (localCluster .getSuccessfulShards (), equalTo (localCluster .getTotalShards ()));
238
- assertThat (localCluster .getSkippedShards (), equalTo (0 ));
239
- assertThat (localCluster .getFailedShards (), equalTo (0 ));
203
+ assertClusterInfoSuccess (localCluster , localCluster .getSuccessfulShards ());
240
204
}
241
205
}
242
206
@@ -264,26 +228,13 @@ public void testEnrichTwiceThenAggsWithUnavailableRemotes() throws IOException {
264
228
assertCCSExecutionInfoDetails (executionInfo );
265
229
266
230
EsqlExecutionInfo .Cluster cluster1 = executionInfo .getCluster (REMOTE_CLUSTER_1 );
267
- assertThat (cluster1 .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
268
- assertThat (cluster1 .getTotalShards (), equalTo (0 ));
269
- assertThat (cluster1 .getSuccessfulShards (), equalTo (0 ));
270
- assertThat (cluster1 .getSkippedShards (), equalTo (0 ));
271
- assertThat (cluster1 .getFailedShards (), equalTo (0 ));
272
- assertThat (cluster1 .getTook ().millis (), greaterThanOrEqualTo (0L ));
231
+ assertClusterInfoSkipped (cluster1 );
273
232
274
233
EsqlExecutionInfo .Cluster cluster2 = executionInfo .getCluster (REMOTE_CLUSTER_2 );
275
- assertThat (cluster2 .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
276
- assertThat (cluster2 .getTotalShards (), equalTo (0 ));
277
- assertThat (cluster2 .getSuccessfulShards (), equalTo (0 ));
278
- assertThat (cluster2 .getSkippedShards (), equalTo (0 ));
279
- assertThat (cluster2 .getFailedShards (), equalTo (0 ));
234
+ assertClusterInfoSkipped (cluster2 );
280
235
281
236
EsqlExecutionInfo .Cluster localCluster = executionInfo .getCluster (RemoteClusterAware .LOCAL_CLUSTER_GROUP_KEY );
282
- assertThat (localCluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SUCCESSFUL ));
283
- assertThat (localCluster .getTotalShards (), greaterThan (0 ));
284
- assertThat (localCluster .getSuccessfulShards (), equalTo (localCluster .getTotalShards ()));
285
- assertThat (localCluster .getSkippedShards (), equalTo (0 ));
286
- assertThat (localCluster .getFailedShards (), equalTo (0 ));
237
+ assertClusterInfoSuccess (localCluster , localCluster .getSuccessfulShards ());
287
238
}
288
239
}
289
240
}
@@ -326,18 +277,10 @@ public void testEnrichCoordinatorThenAnyWithSingleUnavailableRemoteAndLocal() th
326
277
assertCCSExecutionInfoDetails (executionInfo );
327
278
328
279
EsqlExecutionInfo .Cluster cluster1 = executionInfo .getCluster (REMOTE_CLUSTER_1 );
329
- assertThat (cluster1 .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
330
- assertThat (cluster1 .getTotalShards (), equalTo (0 ));
331
- assertThat (cluster1 .getSuccessfulShards (), equalTo (0 ));
332
- assertThat (cluster1 .getSkippedShards (), equalTo (0 ));
333
- assertThat (cluster1 .getFailedShards (), equalTo (0 ));
280
+ assertClusterInfoSkipped (cluster1 );
334
281
335
282
EsqlExecutionInfo .Cluster localCluster = executionInfo .getCluster (RemoteClusterAware .LOCAL_CLUSTER_GROUP_KEY );
336
- assertThat (localCluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SUCCESSFUL ));
337
- assertThat (localCluster .getTotalShards (), greaterThan (0 ));
338
- assertThat (localCluster .getSuccessfulShards (), equalTo (localCluster .getTotalShards ()));
339
- assertThat (localCluster .getSkippedShards (), equalTo (0 ));
340
- assertThat (localCluster .getFailedShards (), equalTo (0 ));
283
+ assertClusterInfoSuccess (localCluster , localCluster .getSuccessfulShards ());
341
284
}
342
285
}
343
286
} finally {
@@ -382,11 +325,7 @@ public void testEnrichCoordinatorThenAnyWithSingleUnavailableRemoteAndNotLocal()
382
325
assertCCSExecutionInfoDetails (executionInfo );
383
326
384
327
EsqlExecutionInfo .Cluster cluster1 = executionInfo .getCluster (REMOTE_CLUSTER_1 );
385
- assertThat (cluster1 .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
386
- assertThat (cluster1 .getTotalShards (), equalTo (0 ));
387
- assertThat (cluster1 .getSuccessfulShards (), equalTo (0 ));
388
- assertThat (cluster1 .getSkippedShards (), equalTo (0 ));
389
- assertThat (cluster1 .getFailedShards (), equalTo (0 ));
328
+ assertClusterInfoSkipped (cluster1 );
390
329
}
391
330
}
392
331
} finally {
@@ -427,26 +366,13 @@ public void testEnrichRemoteWithVendor() throws IOException {
427
366
assertCCSExecutionInfoDetails (executionInfo );
428
367
429
368
EsqlExecutionInfo .Cluster cluster1 = executionInfo .getCluster (REMOTE_CLUSTER_1 );
430
- assertThat (cluster1 .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
431
- assertThat (cluster1 .getTotalShards (), equalTo (0 ));
432
- assertThat (cluster1 .getSuccessfulShards (), equalTo (0 ));
433
- assertThat (cluster1 .getSkippedShards (), equalTo (0 ));
434
- assertThat (cluster1 .getFailedShards (), equalTo (0 ));
435
- assertThat (cluster1 .getTook ().millis (), greaterThanOrEqualTo (0L ));
369
+ assertClusterInfoSkipped (cluster1 );
436
370
437
371
EsqlExecutionInfo .Cluster cluster2 = executionInfo .getCluster (REMOTE_CLUSTER_2 );
438
- assertThat (cluster2 .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SUCCESSFUL ));
439
- assertThat (cluster2 .getTotalShards (), greaterThan (0 ));
440
- assertThat (cluster2 .getSuccessfulShards (), equalTo (cluster2 .getSuccessfulShards ()));
441
- assertThat (cluster2 .getSkippedShards (), equalTo (0 ));
442
- assertThat (cluster2 .getFailedShards (), equalTo (0 ));
372
+ assertClusterInfoSuccess (cluster2 , cluster2 .getSuccessfulShards ());
443
373
444
374
EsqlExecutionInfo .Cluster localCluster = executionInfo .getCluster (RemoteClusterAware .LOCAL_CLUSTER_GROUP_KEY );
445
- assertThat (localCluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SUCCESSFUL ));
446
- assertThat (localCluster .getTotalShards (), greaterThan (0 ));
447
- assertThat (localCluster .getSuccessfulShards (), equalTo (localCluster .getTotalShards ()));
448
- assertThat (localCluster .getSkippedShards (), equalTo (0 ));
449
- assertThat (localCluster .getFailedShards (), equalTo (0 ));
375
+ assertClusterInfoSuccess (localCluster , localCluster .getSuccessfulShards ());
450
376
}
451
377
}
452
378
@@ -478,26 +404,13 @@ public void testEnrichRemoteWithVendor() throws IOException {
478
404
assertCCSExecutionInfoDetails (executionInfo );
479
405
480
406
EsqlExecutionInfo .Cluster cluster1 = executionInfo .getCluster (REMOTE_CLUSTER_1 );
481
- assertThat (cluster1 .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
482
- assertThat (cluster1 .getTotalShards (), equalTo (0 ));
483
- assertThat (cluster1 .getSuccessfulShards (), equalTo (0 ));
484
- assertThat (cluster1 .getSkippedShards (), equalTo (0 ));
485
- assertThat (cluster1 .getFailedShards (), equalTo (0 ));
486
- assertThat (cluster1 .getTook ().millis (), greaterThanOrEqualTo (0L ));
407
+ assertClusterInfoSkipped (cluster1 );
487
408
488
409
EsqlExecutionInfo .Cluster cluster2 = executionInfo .getCluster (REMOTE_CLUSTER_2 );
489
- assertThat (cluster2 .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
490
- assertThat (cluster2 .getTotalShards (), equalTo (0 ));
491
- assertThat (cluster2 .getSuccessfulShards (), equalTo (0 ));
492
- assertThat (cluster2 .getSkippedShards (), equalTo (0 ));
493
- assertThat (cluster2 .getFailedShards (), equalTo (0 ));
410
+ assertClusterInfoSkipped (cluster2 );
494
411
495
412
EsqlExecutionInfo .Cluster localCluster = executionInfo .getCluster (RemoteClusterAware .LOCAL_CLUSTER_GROUP_KEY );
496
- assertThat (localCluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SUCCESSFUL ));
497
- assertThat (localCluster .getTotalShards (), greaterThan (0 ));
498
- assertThat (localCluster .getSuccessfulShards (), equalTo (localCluster .getTotalShards ()));
499
- assertThat (localCluster .getSkippedShards (), equalTo (0 ));
500
- assertThat (localCluster .getFailedShards (), equalTo (0 ));
413
+ assertClusterInfoSuccess (localCluster , localCluster .getSuccessfulShards ());
501
414
}
502
415
}
503
416
}
0 commit comments