Skip to content

Commit 30fc198

Browse files
committed
Updated YAML Clean Up
1 parent d370e7d commit 30fc198

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

tests/Elasticsearch/Tests/Utility.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,11 @@ private static function wipeDataStreams(Client $client): void
304304
} catch (ElasticsearchException $e) {
305305
// We hit a version of ES that doesn't understand expand_wildcards, try again without it
306306
try {
307-
$client->indices()->deleteDataStream([
308-
'name' => '*'
309-
]);
307+
if (getenv('TEST_SUITE') === 'platinum') {
308+
$client->indices()->deleteDataStream([
309+
'name' => '*'
310+
]);
311+
}
310312
} catch (ElasticsearchException $e) {
311313
// We hit a version of ES that doesn't serialize DeleteDataStreamAction.Request#wildcardExpressionsOriginallySpecified
312314
// field or that doesn't support data streams so it's safe to ignore
@@ -476,6 +478,9 @@ private static function isXPackTemplate(string $name): bool
476478
if (strpos($name, '.transform-') !== false) {
477479
return true;
478480
}
481+
if (strpos($name, '.deprecation-') !== false) {
482+
return true;
483+
}
479484
switch ($name) {
480485
case ".watches":
481486
case "logstash-index-template":
@@ -577,13 +582,11 @@ private static function deleteAllTasks(Client $client): void
577582
*/
578583
private static function deleteAllNodeShutdownMetadata(Client $client)
579584
{
580-
$nodes = $client->shutdown()->getNode();
581-
if (isset($nodes['_nodes']) && isset($nodes['cluster_name'])) {
582-
// If the response contains these two keys, the feature flag isn't enabled on this cluster, so skip out now.
583-
// We can't check the system property directly because it only gets set for the cluster under test's JVM, not for the test
584-
// runner's JVM.
585+
if (getenv('TEST_SUITE') !== 'platinum' || version_compare(self::getVersion($client), '7.15.0') < 0) {
586+
// Node shutdown APIs are only present in xpack from 7.15+
585587
return;
586588
}
589+
$nodes = $client->shutdown()->getNode();
587590
foreach ($nodes['nodes'] as $node) {
588591
$client->shutdown()->deleteNode($node['node_id']);
589592
}

0 commit comments

Comments
 (0)