14
14
import org .elasticsearch .client .internal .Client ;
15
15
import org .elasticsearch .cluster .health .ClusterHealthStatus ;
16
16
import org .elasticsearch .common .settings .Settings ;
17
+ import org .elasticsearch .common .util .FeatureFlag ;
17
18
import org .elasticsearch .core .TimeValue ;
18
19
import org .elasticsearch .index .query .MatchAllQueryBuilder ;
19
20
import org .elasticsearch .search .builder .SearchSourceBuilder ;
22
23
import org .elasticsearch .test .ESIntegTestCase .Scope ;
23
24
import org .elasticsearch .test .InternalTestCluster ;
24
25
import org .junit .Assert ;
26
+ import org .junit .BeforeClass ;
25
27
26
28
import java .util .Collection ;
27
29
import java .util .List ;
@@ -44,6 +46,7 @@ public class ClusterStatsRemoteIT extends AbstractMultiClustersTestCase {
44
46
private static final String REMOTE2 = "cluster-b" ;
45
47
46
48
private static final String INDEX_NAME = "demo" ;
49
+ private static final FeatureFlag CCS_TELEMETRY_FEATURE_FLAG = new FeatureFlag ("ccs_telemetry" );
47
50
48
51
@ Override
49
52
protected boolean reuseClusters () {
@@ -60,6 +63,11 @@ protected Map<String, Boolean> skipUnavailableForRemoteClusters() {
60
63
return Map .of (REMOTE1 , false , REMOTE2 , true );
61
64
}
62
65
66
+ @ BeforeClass
67
+ protected static void skipIfTelemetryDisabled () {
68
+ assumeTrue ("Skipping test as CCS_TELEMETRY_FEATURE_FLAG is disabled" , CCS_TELEMETRY_FEATURE_FLAG .isEnabled ());
69
+ }
70
+
63
71
public void testRemoteClusterStats () throws ExecutionException , InterruptedException {
64
72
setupClusters ();
65
73
final Client client = client (LOCAL_CLUSTER );
@@ -117,7 +125,7 @@ private void setupClusters() {
117
125
int numShardsRemote = randomIntBetween (2 , 10 );
118
126
for (String clusterAlias : remoteClusterAlias ()) {
119
127
final InternalTestCluster remoteCluster = cluster (clusterAlias );
120
- remoteCluster .ensureAtLeastNumDataNodes (randomIntBetween (1 , 3 ));
128
+ remoteCluster .ensureAtLeastNumDataNodes (randomIntBetween (2 , 3 ));
121
129
assertAcked (
122
130
client (clusterAlias ).admin ()
123
131
.indices ()
0 commit comments