@@ -370,6 +370,7 @@ public void initClient() throws IOException {
370370 availableFeatures = EnumSet .of (ProductFeature .LEGACY_TEMPLATES );
371371 Set <String > versions = new HashSet <>();
372372 boolean serverless = false ;
373+ String multiProjectPluginVariant = null ;
373374
374375 for (Map <?, ?> nodeInfo : getNodesInfo (adminClient ).values ()) {
375376 var nodeVersion = nodeInfo .get ("version" ).toString ();
@@ -399,8 +400,10 @@ public void initClient() throws IOException {
399400 if (moduleName .startsWith ("serverless-" )) {
400401 serverless = true ;
401402 }
402- if (moduleName .contains ("multi-project" )) {
403- multiProjectEnabled = true ;
403+ if (moduleName .contains ("test-multi-project" )) {
404+ multiProjectPluginVariant = "test" ;
405+ } else if (moduleName .contains ("serverless-multi-project" )) {
406+ multiProjectPluginVariant = "serverless" ;
404407 }
405408 }
406409 if (serverless ) {
@@ -423,6 +426,18 @@ public void initClient() throws IOException {
423426 .collect (Collectors .toSet ());
424427 assert semanticNodeVersions .isEmpty () == false || serverless ;
425428
429+ final var response = entityAsMap (
430+ adminClient .performRequest (
431+ new Request (
432+ "GET" ,
433+ "/_cluster/settings?include_defaults&filter_path=*." + multiProjectPluginVariant + ".multi_project.enabled"
434+ )
435+ )
436+ );
437+ multiProjectEnabled = Boolean .parseBoolean (
438+ ObjectPath .evaluate (response , "defaults." + multiProjectPluginVariant + ".multi_project.enabled" )
439+ );
440+
426441 testFeatureService = createTestFeatureService (getClusterStateFeatures (adminClient ), semanticNodeVersions );
427442 }
428443
0 commit comments